Author Topic: Extract Drawing Scale in LDD  (Read 2522 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
Extract Drawing Scale in LDD
« on: February 08, 2005, 09:24:23 AM »
LDD 2004

Can anyone offer any help with extracting out the user selected Drawing Scale in LDD. Menu Projects >> Drawing Setup >> Scale Tab. Is this a variable or setting that can be "seen" elsewhere? I would like to potentially apply this to part of a Script or even another LISP routine.

Thanks,
Dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Extract Drawing Scale in LDD
« Reply #1 on: February 08, 2005, 10:35:04 AM »
Look at your 'dimscale' variable. Should be one in the same.
TheSwamp.org  (serving the CAD community since 2003)

DanB

  • Bull Frog
  • Posts: 367
Extract Drawing Scale in LDD
« Reply #2 on: February 08, 2005, 11:48:50 AM »
Thanks Mark :D

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Extract Drawing Scale in LDD
« Reply #3 on: February 08, 2005, 01:39:35 PM »
Quote from: Mark Thomas
Look at your 'dimscale' variable. Should be one in the same.
Not neccesarily true. Initially, yes, but if you have different dimstyles setup and use them in your drawings, then your dimscale may not be the same as the drawing scale.

The actual stored location is obtained either by getting the AeccDatabasePreferences-DatabaseScale:
Code: [Select]

  (setq acadObj  (vlax-get-acad-object))
  (setq aecApp  (vla-getinterfaceobject acadObj "Aecc.Application"))
  (setq aecDoc (vlax-get aecApp "ActiveDocument"))
  (setq PrefDoc (vlax-get aecDoc "preferences"))
  (setq Hscale (vlax-get PrefDoc "DatabaseScale"))

 or through Dictionaries:
Code: [Select]

(defun getscale ( / dicts aecdict aec1 aecEnt)
  (setq dicts (vla-get-dictionaries *doc*))a
  (setq aecdict (vla-item dicts "AEC_VARS"))
  (setq aec1 (vla-item aecdict "AEC_VARS_DWG_SETUP"))
  (setq aecEnt (entget (vlax-vla-object->ename aec1)))
  (cdr (assoc 40 aecEnt))
  )

DanB

  • Bull Frog
  • Posts: 367
Extract Drawing Scale in LDD
« Reply #4 on: February 09, 2005, 07:32:54 AM »
This looks useful too, Thanks Jeff_M.

PS. I put together some of the code for the other lisp we were discussing, some parts are working, and err some I'm still troubleshooting, will try to keep you posted you've been a big help to me.

Dan