.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Exploding Blocks

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
mathewkol
1245 Views, 3 Replies

Exploding Blocks

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?

 

Thanks.

 

        '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

 

 

Matt Kolberg
SolidCAD Professional Services
http://www.solidcad.ca /
3 REPLIES 3
Message 2 of 4
Jeffrey_H
in reply to: mathewkol

You need to erase the original object

 and you say blocks do you mean BlockReferences or show full code

 

You can also find your answers @ TheSwamp
Message 3 of 4
mathewkol
in reply to: Jeffrey_H

Correct, I mean BlockReferences.  So after I erase the original object, all the objects from the explode will just appear?

Matt Kolberg
SolidCAD Professional Services
http://www.solidcad.ca /
Message 4 of 4
mathewkol
in reply to: Jeffrey_H

Thanks.  I got it working.

Matt Kolberg
SolidCAD Professional Services
http://www.solidcad.ca /

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost