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.
Correct, I mean BlockReferences. So after I erase the original object, all the objects from the explode will just appear?