Runtime
-
This question came up during last week's accelerator, and is part of the reason I spent creating the last post: is it possible to selectively unlock certain layers for the duration of commands that have been specified by the user? Let's take an example: you have layers that should remain locked, apart from when using […]
-
In the last post we saw a "general" function to erase all the entities in a drawing that fulfill a specified condition. We used it to erase all the zero-length lines in a drawing. But as I'd mentioned at the end, I thought there was an opportunity to generalize the mechanism even further. Here's what […]
-
A question came in by email, yesterday, and despite having a few mini-projects in progress that were spawned during last week's event in Prague, I couldn't resist putting some code together to address it. The developer wanted to purge zero-length geometry: the simplest way to solve the problem is to run "_-PURGE _Z" at the […]
-
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 […]
-
After the last post, where we saw how to get the centroid of a Region, today we're going to use that information to place some text inside a detected space. To restate our process from last time: The user selects a point Call Editor.TraceBoundary() to determine the containing space Call Region.CreateFromCurves() with the resulting geometry […]
-
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 question came in as a blog comment on this previous post: Is possible to use Revision Cloud in this situation? Example: Creating a polyline/circle/ellipse then make it a revision cloud. It seemed to make sense to broaden the topic for the purposes of this blog post: how to pass an entity or entities to […]
-
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 […]
-
Here's an interesting question that came in from Nick Gilbert via a blog comment: Is there a simple way to get the geometric extents of the group? As discussed in this previous post, the Group object in AutoCAD presents itself as a collection of geometric objects (or entities, in ObjectARX-parlance). But a Group, in itself, […]