Solved! Go to Solution.
Solved by Jeffrey_H. Go to Solution.
If you just want to explode the main Xref block and place all the resulting objects in Model or Paper space, then you just open the BlockReference and call ExplodeToOwnerSpace()
If you want more control over the objects, or want to explode nested blocks or whatever, then you open the BlockReference and call bref.Explode(DbObjectCollection). You pass it an empty DbObjectCollection and the resulting objects created by the Explode are put into the Collection. Then you are responsible for both Adding those objects to the Database and erasing the original object.
I have never used ExplodeToOwnerSpace, so I am not sure, but I think in that case you would also be responsible for erasing the original object, but the exploded objects are automatically added to whatever the parent BlockTableRecord was.
Hi,
Now i wrote a procedure to explode all block references.
But i got error msg as eCannotScaleNonUniformly.
I have uniformly scaled blocks only. Below is my code.
Anyone can help me, please.
note: code is attached.
hi,
now i try some other way using 'explodetoownerspace'.
but i did not achive result.
i got 'einvalidinput' error.
please help me.
This worked for me with non-uniformed scaled blocks
<CommandMethod("ExplodeBlocks")> _ Public Sub ExplodeBlocks() Dim doc As Document = Application.DocumentManager.MdiActiveDocument Dim db As Database = doc.Database Dim ed As Editor = doc.Editor Using trx As Transaction = db.TransactionManager.StartTransaction Dim bt As BlockTable = db.BlockTableId.GetObject(OpenMode.ForRead) For Each btrObjId As ObjectId In bt Dim btr As BlockTableRecord = btrObjId.GetObject(OpenMode.ForRead) If btr.IsLayout Or btr.IsAnonymous Then Continue For End If Dim objIdColl As ObjectIdCollection = btr.GetBlockReferenceIds(True, True) For Each objId As ObjectId In objIdColl Dim acBref As BlockReference = objId.GetObject(OpenMode.ForWrite) MsgBox(acBref.Name) acBref.ExplodeToOwnerSpace() Next Next trx.Commit() End Using End Sub