Valued Contributor
63 Posts
2 Kudos
Registered: ‎11-24-2009
Post 1 of 4

Explode Dimension

644 Views, 3 Replies
02-20-2010 04:21 PM
I'm looking for a way to explode a dimension. I've tried using the Explode() method, but it just results in an eInvalidInput error. Is there a way to explode a dimension into objects?

The reason for this is that I'm using Autocad Architecture and I'm auto-labeling and dimensioning some items I am inserting into the drawing, however the 2d elevation drawing tool in Architecture automatically ignores text and dimensions, so I need a way to explode these into lines so they will show up in the 2d elevation drawings.
Valued Contributor
63 Posts
2 Kudos
Registered: ‎11-24-2009
Post 2 of 4

Re: Explode Dimension

03-08-2010 04:25 AM in reply to: dwi_it
So, am I to assume that this is not possible?
Active Contributor
33 Posts
0 Kudos
Registered: ‎03-11-2010
Post 3 of 4

Re: Explode Dimension

08-15-2012 09:57 AM in reply to: dwi_it

You could use the BURST command to explode dimenisons. BURST can be executed via the SendCommand() method.


For example to explode everything including dimensions, the following snippet works:


public static void ExplodeAllDrawingEntitiesViaSendCommand() {

 where SendCommand is exposed as an extension method


    public static void SendCommand(this string commandFormat, params object[] args) {
        var acadApplication = a.Application.AcadApplication as AcadApplication;
        acadApplication.ActiveDocument.SendCommand(string.Format(commandFormat, args));

 The downside with this approach is that it requires interop with COM dlls.

*Expert Elite*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 4 of 4

Re: Explode Dimension

08-15-2012 01:05 PM in reply to: dwi_it

Not sure about if this work on your end,

I tested on A2010 all is good for me

    <CommandMethod("dex")> _
    Public Sub TestExplode()
        Dim doc As Document = Application.DocumentManager.MdiActiveDocument
        Dim ed As Editor = doc.Editor
        ' Select a dimension           
        Dim opts As New PromptEntityOptions(vbLf & "Select a dimension:")
        opts.SetRejectMessage(vbLf & "Must be a dimension...")
        ' opts.AddAllowedClass(GetType(Dimension), False)
        Dim res As PromptEntityResult = ed.GetEntity(opts)
        If res.Status <> PromptStatus.OK Then
            Exit Sub
        End If

        Dim db As Database = doc.Database
        Using trans As Transaction = db.TransactionManager.StartTransaction
            Dim dm As DBObject = trans.GetObject(res.ObjectId, OpenMode.ForRead)
            ed.WriteMessage(vbLf + "{0}", dm.GetType().Name)
            Dim m_dim As Dimension = TryCast(dm, Dimension)
            Dim objs As DBObjectCollection = New DBObjectCollection
            Dim btr As BlockTableRecord = trans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite)
            'add exploded object to database
            For Each obj As DBObject In objs
                Dim ent As Entity = TryCast(obj, Entity)
                If TypeOf ent Is MText Then
                    Dim mtx As MText = TryCast(ent, MText)
                    'change textstyle here
                    mtx.TextHeight = mtx.TextHeight * 0.5
                End If
                trans.AddNewlyCreatedDBObject(ent, True)
                ed.WriteMessage(vbLf + "{0}", obj.GetType().Name)
            'erase dimension

        End Using
    End Sub



Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!