Jump to content

Recommended Posts

Posted

I am making some routines in VBA

 

I need to know the units of the drawings I recieve so I can setup the variables.

 

I have found a class named AcMeasurementUnit but dont know how to retrieve the info in it.

 

Please... help.:cry:

 

thanks!

Posted

Are you maybe after something like this

 

(defun civ_units ()
(SETQ ANGBASEE (GETVAR "ANGBASE"))
(SETQ ANGDIRR (GETVAR "ANGDIR"))
(SETQ LUNITSS (GETVAR "LUNITS"))
(SETQ LUPRECC (GETVAR "LUPREC"))
(SETQ AUNITSS (GETVAR "AUNITS"))
(SETQ AUPRECC (GETVAR "AUPREC"))
(SETVAR "LUNITS" 2)
(SETVAR "ANGBASE" 0.0)
(SETVAR "ANGDIR" 0)
(SETVAR "LUPREC" 0)
(SETVAR "AUNITS" 0)
(SETVAR "AUPREC" 0)
)
(defun old_civ_units ()
(SETVAR "LUNITS" lunitss)
(SETVAR "ANGBASE" angbasee)
(SETVAR "ANGDIR" angdirr)
(SETVAR "LUPREC" luprecc)
(SETVAR "AUNITS" aunitss)
(SETVAR "AUPREC" auprecc)
)

 

probably will meet you needs may just need a few more variables.

Posted

how about

thisdrawing.GetVariable("lunits")

and

 
thisdrawing.SetVariable "lunits",1

Posted

Thread moved in the VBA forum.

Welcome Andresing!

  • 2 weeks later...
Posted
    
Dim MUnits As Integer

MUnits = ThisDrawing.GetVariable("lunits")


If MUnits = 2 Then
       MsgBox MUnits & " Drawing in Milimeters"
Else
       MsgBox MUnits & " Drawing in Inches"
End If

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...