Author Topic: Explode Dims  (Read 7702 times)

0 Members and 1 Guest are viewing this topic.

Dan

  • Guest
Explode Dims
« on: June 07, 2007, 01:05:09 PM »
Hello All, I am new to the forum, and I have dabbled in VBA, by far I am no expert.
I am trying to figure out a method to explode a dimension.  Any advice would be greatly appreciated.
Thanks,
Dan

Code: [Select]
Sub ExplodeDim()

Dim sstext As AcadSelectionSet
Dim blk As AcadBlockReference
Dim oEnt As AcadEntity
Dim FilterType(1) As Integer
Dim FilterData(1) As Variant


    On Error Resume Next
    ThisDrawing.SelectionSets.Item("XDim").Delete
    Set sstext = ThisDrawing.SelectionSets.Add("XDim")

    FilterType(0) = 67
    FilterData(0) = 0
    FilterType(1) = 0
    FilterData(1) = "Dimension"

    sstext.Select acSelectionSetAll, , , FilterType, FilterData
   
    For Each oEnt In sstext
        If TypeOf oEnt Is AcadDimAligned Then
            If oEnt.TextColor = 5 And oEnt.TextOverride <> " " And oEnt.TextOverride <> "" Then

                    'Explode Dim here

            End If
        End If
    Next

End Sub

Guest

  • Guest
Re: Explode Dims
« Reply #1 on: June 07, 2007, 01:20:14 PM »
Hello All, I am new to the forum, and I have dabbled in VBA, by far I am no expert.
I am trying to figure out a method to explode a dimension.  Any advice would be greatly appreciated.
Thanks,
Dan

From the AutoCAD Bible... 'Thou shalt never explode dimensions!'

Anyways... I don't believe it can be programmatically with VBA.



Speaking of exploding dimensions..... http://www.penwill.com/cadgall07.html

Guest

  • Guest
Re: Explode Dims
« Reply #2 on: June 07, 2007, 01:28:50 PM »
You COULD use this, but it's kind of a hack...

Code: [Select]
Public Sub Main()
    Dim objDim As AcadDimension
    Dim varPickPoint As Variant
    Dim PickPoint As String
   
    ThisDrawing.Utility.GetEntity objDim, varPickPoint, "Pick a dimension to explode..."
    PickPoint = varPickPoint(0) & "," & varPickPoint(1) & "," & varPickPoint(2)
   
    ThisDrawing.SendCommand "EXPLODE " & PickPoint & vbCrLf
End Sub

deegeecees

  • Guest
Re: Explode Dims
« Reply #3 on: June 07, 2007, 01:32:57 PM »
Could use a filter to select all dimension objects, then use the "sendcommand" method. Don't have time to code it, just a thought.

Dan

  • Guest
Re: Explode Dims
« Reply #4 on: June 07, 2007, 03:49:57 PM »

From the AutoCAD Bible... 'Thou shalt never explode dimensions!'




True, but in this case, I wish to explode only a few particular dims.

I did have a lead my research found, but the site is gone:

>Check Randall Rath's site [www.vbdesign.net] and search for it. It is
>possible to explode them programmatically, just not as dimensions.
>Dimensions are, after all, just unnamed blocks. Randall's article will
>explain, but if I remember correctly, a dimension's handle is one number
>less than its blocks name. Anyway, check out his site.

Thanks,
Dan

Maverick®

  • Seagull
  • Posts: 14778
Re: Explode Dims
« Reply #5 on: June 07, 2007, 04:14:15 PM »
*Sidenote*

  The Squirrels name has been unleashed!  Run! Run for your sanity!

Dan

  • Guest
Re: Explode Dims
« Reply #6 on: June 07, 2007, 04:19:30 PM »
*Sidenote*

  The Squirrels name has been unleashed!  Run! Run for your sanity!

Ok, I just started....please clue me in to this!

deegeecees

  • Guest
Re: Explode Dims
« Reply #7 on: June 07, 2007, 04:20:22 PM »
Ahhhhh! Where's my Hollow Point Peanuts?!

Maverick®

  • Seagull
  • Posts: 14778
Re: Explode Dims
« Reply #8 on: June 07, 2007, 04:31:20 PM »
  Sorry Dan.  Just the reference to RR.  Some of us here have a little bit of history with him.  He used a squirrel for his Avatar.  Totally off topic, I just hadn't seen his name for a while.  :-D

Dan

  • Guest
Re: Explode Dims
« Reply #9 on: June 07, 2007, 04:39:04 PM »
Ahhhhh! Where's my Hollow Point Peanuts?!
Now this makes sense..Thanks!

Guest

  • Guest
Re: Explode Dims
« Reply #10 on: June 07, 2007, 04:40:19 PM »
  Sorry Dan.  Just the reference to RR.  Some of us here have a little bit of history with him.  He used a squirrel for his Avatar.  Totally off topic, I just hadn't seen his name for a while.  :-D
Did he ever let you ride his llama??!?

Josh Nieman

  • Guest
Re: Explode Dims
« Reply #11 on: June 07, 2007, 04:42:57 PM »
  Sorry Dan.  Just the reference to RR.  Some of us here have a little bit of history with him.  He used a squirrel for his Avatar.  Totally off topic, I just hadn't seen his name for a while.  :-D
Did he ever let you ride his llama??!?

whoa whoa whoa... that's gettin' kinda...

er...

I think I'll just be on my way now

Guest

  • Guest
Re: Explode Dims
« Reply #12 on: June 07, 2007, 04:45:19 PM »
  Sorry Dan.  Just the reference to RR.  Some of us here have a little bit of history with him.  He used a squirrel for his Avatar.  Totally off topic, I just hadn't seen his name for a while.  :-D
Did he ever let you ride his llama??!?

whoa whoa whoa... that's gettin' kinda...

er...

I think I'll just be on my way now
He even had a nickname for it to.... Ralph the Wonder Llama.   Aaaahhhh yup!

Maverick®

  • Seagull
  • Posts: 14778
Re: Explode Dims
« Reply #13 on: June 07, 2007, 04:47:40 PM »
whoa whoa whoa... that's gettin' kinda...

It gets worse.

He even had a nickname for it to.... Ralph the Wonder Llama.   Aaaahhhh yup!

  Ralph is his son.  If they are to be believed.

Dan

  • Guest
Re: Explode Dims
« Reply #14 on: June 07, 2007, 04:51:05 PM »
WOW, what an opening thread. This is my first day here, and I think I opened a door I was completely unaware of.

And all I wanted was to explode a dim, ha ha...

Thanks for the welcome...