Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AeccParcel Explode

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Alexey.Terno
1062 Views, 7 Replies

AeccParcel Explode

How can I explode an AeccParcel object?

7 REPLIES 7
Message 2 of 8
hippe013
in reply to: Alexey.Terno

Parcels can be exploded with the explode command.

Message 3 of 8
Alexey.Terno
in reply to: hippe013

Usually it is, but in this case there is no such command:

2017-04-09_19-48-45.png

Message 4 of 8
hippe013
in reply to: Alexey.Terno

I guess I'm a bit confused. Are you saying you don't have the explode command?
Message 5 of 8
hippe013
in reply to: Alexey.Terno

I just now saw your image. I see now. Stand by.
Message 6 of 8
hippe013
in reply to: hippe013

A base type of the Parcel is Entity which contains the explode method. Consider the following example. 

<CommandMethod("TestExplode")> _
        Public Sub TestExplode()
            Dim aDoc As Document = Application.DocumentManager.MdiActiveDocument
            Dim ed As Editor = aDoc.Editor
            Dim db As Database = aDoc.Database
            Dim opts As New PromptEntityOptions(vbCrLf + "Select Parcel")
            Dim res As PromptEntityResult = ed.GetEntity(opts)
            If res.Status = PromptStatus.OK Then
                Dim dbObjCol As New DBObjectCollection
                Dim BlkTbl As BlockTable
                Dim BlkTblRec As BlockTableRecord
                Using trans As Transaction = db.TransactionManager.StartTransaction
                    Dim ent As Entity = trans.GetObject(res.ObjectId, OpenMode.ForWrite)
                    BlkTbl = trans.GetObject(db.BlockTableId, OpenMode.ForRead)
                    BlkTblRec = trans.GetObject(BlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
                    ent.Explode(dbObjCol)
                    For Each XEnt As Entity In dbObjCol
                        BlkTblRec.AppendEntity(XEnt)
                        trans.AddNewlyCreatedDBObject(XEnt, True)
                    Next
                    trans.Commit()
                End Using
            End If
        End Sub

 

 

 

 

Message 7 of 8
Alexey.Terno
in reply to: hippe013

"Entity " is a .NET class and "AeccParcel" is COM object but I can convert old id to ObjectId:

ObjectId id = new ObjectId((IntPtr)parcel.ObjectID);
Db.Parcel p = (Db.Parcel)_trans.GetObject(id, OpenMode.ForWrite);
DBObjectCollection objs = new DBObjectCollection();
p.Explode(objs);

Thanks for the advice!

Message 8 of 8
hippe013
in reply to: Alexey.Terno

Thank you for your input on the converting from COM. 

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report