Below is my existing code. ss is a selection set which has been populated by SelectAll which limits the selection to blocks and tables.
The For Next loop iterates through this collection and attempts to explode each object (ent.Explode(acDBObjColl)
). They do not actually explode and the code does not generate any errors. I can replace the block selection with polylines which do explode. This leads me to believe my code is correct in that it's exploding objects. It just doesn't seem to work with blocks.
How might I get this code to explode blocks?
'explode them If SelectResult.Status = PromptStatus.OK Then ss = SelectResult.Value count = ss.Count For i = 1 To count id = ss.Item(count - 1).ObjectId ent = id.GetObject(OpenMode.ForWrite, True, True) Dim acDBObjColl As DBObjectCollection = New DBObjectCollection() ent.Explode(acDBObjColl) For Each acEnt As Entity In acDBObjColl btrModelSpace.AppendEntity(acEnt) trans.AddNewlyCreatedDBObject(acEnt, True) Next trans.Commit() Next ss.Dispose() End If
Solved! Go to Solution.
Solved! by Jeffrey_H. See the answer in context.
You need to erase the original object
and you say blocks do you mean BlockReferences or show full code
Correct, I mean BlockReferences. So after I erase the original object, all the objects from the explode will just appear?
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!