Hello, I am doing a customization in AutoCAD2013 using C# as development language. The Application runs outside AutoCAD and is a COM Application. However i am stuck at explode option currently i am sending command to AutoCAD to select all and then explode. This works some times and some times doesn't work hence results are improper
Is there any possibility to explode using COM interface.
rgds
Amit
Solved! Go to Solution.
Solved by norman.yuan. Go to Solution.
Yes, COM API does provide "Explode" functionality. All of the explode-able COM objects (AcadBlockReference, AcadLWPolyline, AcadRegion...) have a method Explode().
Norman Yuan
Hi Norman Yuan,
Thanks for reply.
Actually this is my below code which i did earlier for Explode, It is not exploding the the way Explode command does.
foreach (AcadEntity acadEnt inacApp.ActiveDocument.Database.ModelSpace)
{
AcadBlockReference acadBlkRef = null;
if (acadEnt.ObjectName.Equals("AcDbBlockReference"))
{
acadBlkRef = acadEnt as AcadBlockReference;
//acadBlkRef.Delete();
acadBlkRef.Explode(); }
}
acApp.ActiveDocument.Save();
How should i explode all data present in drawing, please feel free to change the logic.
rgds
Amit
Well, Explode() method in the COM API does not equal to AutoCAD command "EXPLODE".
The Explode() method simply retuen an array of AcadObjects that makes up the entity "being exploded", which itself remains unchanged after calling the Explode() method.
So, if your intention is to do the same as AutoCAD's EXPLODE command, after you call the Explode() method, which generates a set of individual entities, you need to erase the entity being exploded.
Norman Yuan
No, in COM API, there is no Database/Transaction concept. The AcadObjects generated by calling Explode() method are already in drawing database when the call ends.
Norman Yuan
If you ever did AutoCAD VBA development, you would know to go to AutoCAD's VBA editor, open "Object Browser", select any Object/property/Mothd in Object Browser and click "?" buttom to open VBA Help. In comparison to .NET documentation, COM API is fairly well documented in VBA help, almost every Object/Method/Property comes with sample code.
Norman Yuan
Can't find what you're looking for? Ask the community or share your knowledge.