Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exploding everything in a drawing using VBA

Status
Not open for further replies.

msstrang

Programmer
Sep 19, 2005
62
US
i am currently using a vba program that copies all the text from an autocad 2002 drawing and then places it into an excel spreadsheet. i used to use a lisp program to do this, but it mysteriously stopped working one day..

regardless, with the help of someone on this forum i got my vba to work, but i forgot that i need to explode everything 3 times before all the dimensions will be selected and copied to the excel spreadsheet as well, which is a crucial part of my process.

to do this with lisp i also had to set my qaflags to 0 or 1, i can't rememeber.

i guess my question is how do you explode everything in a drawing using vba, and how do you manipulate the qaflags in autocad with vba.

thanks.
 
don't explode, you can read every dimension value and use it to export it, not only in vba, but in lisp too.
 
eh?
how do i do that? all i know is how to read text from a drawing, how do i export or read dimensions with exploding them into text using VBA?
 
Hi msstrang,

Just off the top of my head:

Code:
Sub DimStrings()
  Dim Ent As AcadEntity
  Dim objDim As AcadDimension
  
  
  For Each Ent In ThisDrawing.ModelSpace
    If Ent.ObjectName = "AcDbRotatedDimension" Then
      Set objDim = Ent
      If objDim.TextOverride = vbNullString Then
        Debug.Print objDim.Measurement
      Else
        Debug.Print objDim.TextOverride
      End If
      
    End If
  Next Ent
  
End Sub

Of course you'll need to make it work for your routine, but hopefully this will point you in the right direction.

HTH
Todd
 
the hard part is to get the ObjectName spelled exactly right with upper and lower cases. You can use the "immediate" window for that, the objectbrowser doesn't mention them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top