Author Topic: AecDwgSetup  (Read 4509 times)

0 Members and 1 Guest are viewing this topic.

mr_nick

  • Guest
AecDwgSetup
« on: May 16, 2007, 09:00:44 AM »
How do I go about determining the drawing units that are being used in a drawing? I want to be able to determine whether the units are set to feet, inches, millimetres, metres etc but can't fathom how to get this info using lisp.

I want to be able to run a quick and simple routine which sets the drawing units in any drawing to my predetermined defaults but I can only figure out how to change between metric and imperial and not any of the sub-classes of these two.

If I use the -AECDWGSETUP command, I can specify that I want to use my required units and precision etc and this works fine if the drawing I run it on has units different to those I require. If howvere the units are already set correctly, I cannot pass the same command string as the prompts are different. If I knew how to determine the units in use I could then add a simple IF/ELSE statement to get around it. Otherwise, is there a system variable which controls the drawing units?

On a side note, I'm using Architecture 2008 and there appears to be a bit of a mess up in the coding of the prompts. If I use the -AECDWGSETUP command and opt for units, I get the following options:

Drawing units:
  1. Inches
  2. Feet
  3. Centimeters
  4. Meters
  5. Decimeters
  6. Meters

In ADT 2006, the same routine gives the following options:

Drawing units:
  1. Inches
  2. Feet
  3. Millimeters
  4. Centimeters
  5. Decimeters
  6. Meters

If I follow this through in 2008, it seems that everything works exactly the same as 2006 and it is just the prompt that is messed up and gives no option for millimetres but two options for metres. I have to select option 3 which actually sets the units to millimetres as it does in 2006.

Is there anybody out there with 2008 that can confirm whether they experience the same glitch or whether it is just me that has a screwy install?

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: AecDwgSetup
« Reply #1 on: May 16, 2007, 09:17:39 AM »
try the following:

;;;          ADT Variable Function         ;
;;;      Layer Standard Drawing (jb:GetADTVar 5)      ;
;;;       Layer Standard  (jb:GetADTVar 9)      ;
;;;       Drawing Scale(jb:GetADTVar 40)         ;
;;;       Annotation size (jb:GetADTVar 42)      ;
;;;                        ;


;;;      Return ADT Variable Value         ;

(defun jb:GetADTVar  (var / dict vars ret)
    ;check to see if the dict exists, if not initialize it . . .
  (if (not (cdar (dictsearch (namedobjdict) "AEC_VARS")))
    (aeclayerkeylist))
  (setq dict (dictsearch
               (cdar (dictsearch (namedobjdict) "AEC_VARS"))
               "AEC_VARS_DWG_SETUP")
        vars (member '(100 . "AecDbVarsDwgSetup") dict)
        ret  (cdr (assoc var vars)))
  ret)

If you have a copy of dbview.arx you can browse the various AEC dictionaries to find all kinds of neat stuff . . ..
James Buzbee
Windows 8

mr_nick

  • Guest
Re: AecDwgSetup
« Reply #2 on: May 16, 2007, 10:03:24 AM »
;;;          ADT Variable Function         ;
;;;      Layer Standard Drawing (jb:GetADTVar 5)      ;
;;;       Layer Standard  (jb:GetADTVar 9)      ;
;;;       Drawing Scale(jb:GetADTVar 40)         ;
;;;       Annotation size (jb:GetADTVar 42)      ;
;;;     
Don't suppose you'd know what number specifically refers to drawing units? I can get area units, scale factors etc but nothing leaps out that links to milli, centi or deci metres  :?


If you have a copy of dbview.arx you can browse the various AEC dictionaries to find all kinds of neat stuff . . ..

Is there a copy of this available for for releases newer than 2006?

-------------------
As a bit of a bodged workaround, I have put in an extra line into my routine which first sets the units to decimetres and then to millimetres. I did this as I have yet to receive a drawing with decimetres used as units (yet) so at the moment I'm fairly safe to use this method - but never say never!!

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: AecDwgSetup
« Reply #3 on: May 16, 2007, 11:42:30 AM »
(jb:GetADTVar 71)

Feet returns 30
Inches returns 31

Milimeters returns 25
Centimeters returns 24
Decimeters returns 23
Meters returns 2
James Buzbee
Windows 8

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: AecDwgSetup
« Reply #4 on: May 16, 2007, 11:49:53 AM »
On a side note, I'm using Architecture 2008 and there appears to be a bit of a mess up in the coding of the prompts. If I use the -AECDWGSETUP command and opt for units, I get the following options:

Drawing units:
  1. Inches
  2. Feet
  3. Centimeters
  4. Meters
  5. Decimeters
  6. Meters

In ADT 2006, the same routine gives the following options:

Drawing units:
  1. Inches
  2. Feet
  3. Millimeters
  4. Centimeters
  5. Decimeters
  6. Meters

If I follow this through in 2008, it seems that everything works exactly the same as 2006 and it is just the prompt that is messed up and gives no option for millimetres but two options for metres. I have to select option 3 which actually sets the units to millimetres as it does in 2006.

Is there anybody out there with 2008 that can confirm whether they experience the same glitch or whether it is just me that has a screwy install?
It looks like I am getting the same. and I use the same platform
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

mr_nick

  • Guest
Re: AecDwgSetup
« Reply #5 on: May 16, 2007, 11:57:37 AM »
(jb:GetADTVar 71)

Feet returns 30
Inches returns 31

Milimeters returns 25
Centimeters returns 24
Decimeters returns 23
Meters returns 2

Fantastic.

Thanks a lot  :-D