Blocks
-
I decided to dust off Visual Studio and write a quick AutoCAD app, this morning. It tackles a question received via a blog comment from Pankaj Potdar, over the weekend. I have two blocks with different attributes I want to merge them in single block, and I don't want to create any nested blocks. I […]
-
After showing how to automatically attach xrefs at the origin inside AutoCAD, and then redoing the approach to take care of different unit systems, I then had the request from a couple of places to look at making the xrefs overlays and adjusting their paths to be relative rather than absolute. Looking around, I found […]
-
This is actually a redo of last week's post, just with a different title: while the approach shown worked well when creating external references to drawings using the same units, when bringing in (for instance) metric xrefs into an imperial master drawing the scale was all messed up. Thanks to Hans Lammerts for reporting the […]
-
I just received this interesting (and quick to solve) question from Henrik Ericson, this morning: I'm looking for a new xref command (or perhaps overriding the internal xref command) that always insert the selected xref at 0,0,0 coordinates and in World coordinate system. I'm often inserting an xref and 'nothing happens' and then I realize […]
-
A really interesting problem came up during an internal discussion, this week: someone wanted to launch the REFEDIT command on a selected xref and pre-select the entity found at the picked point. The entity that's part of the selected xref, of course. This turned out to be quite a tricky problem and yet one that […]
-
This is a follow-up to the post where we modified the size of selected text in a drawing, to make it fit its container. I received this comment last week: instead of selecting the nested entities one by one, is it possible to make a "selectall" selection ? It turns out that the question was […]
-
We started this series by looking at how to get the centroid of a region, and then how to create text that fits an arbitrary space. In this post we're going to wrap up by looking at the original question of how to resize block attributes to fit their container. The core algorithm is actually […]
-
In the last post we introduced a static C# class containing extension methods for the ObjectId and Transaction classes. The new Transaction methods allow you to more easily "lock" objects, whether because they're "system" objects you want to keep around in every drawing or because they're objects that shouldn't be purged at whim by users. […]
-
This is one of those topics that has been at the back of my mind for a number of years. Here's a question I received via a blog comment back in 2009: I was wondering if there's an easy way to modify the objects to purge. For example, if a particular text style was included […]
-
This interesting question came in by email from Igor, over the weekend: Let say I want to delete a layer by it's name. I can get ObjectId or LayerTabelRecord from the name, like LayerTable tLayers = (LayerTable) Transaction.GetObject(Database.LayerTableId,OpenMode.ForRead,false) LayerTableRecord ltRecord = (LayerTableRecord) Transaction.GetObject(tLayers.Item[Name],OpenMode.ForWrite,false); Now having LayerTableRecord how can I found out that this DBObject is […]