How can I change LDD drawing scale using lisp? Changing "ltscale" and "dimscale" isn't working. It seems like after I call a LDD function the scale goes back to what it was in Project>Drawing Setup...
Anyone?
Thanks,
Tom
How can I change LDD drawing scale using lisp? Changing "ltscale" and "dimscale" isn't working. It seems like after I call a LDD function the scale goes back to what it was in Project>Drawing Setup...
Anyone?
Thanks,
Tom
Been a very long time since I programmed lisp, but:
(command "setvar" "dimscale" "x")
(command "setvar" "ltscale" "y")
I use the following in my acad.lsp:
(COMMAND "SETVAR" "LTSCALE" (/ (GETVAR "DIMSCALE") 2))
to make certain my ltscale is 1/2 the dimscale of new or older dwgs.
Tomdum wrote:
Why do you want it different than what you specify in "Drawing Setup"?How can I change LDD drawing scale using lisp? Changing "ltscale"
and "dimscale" isn't working. It seems like after I call a LDD
function the scale goes back to what it was in Project>Drawing
Setup... Anyone? Thanks, Tom
------------
If you are just looking for a way to programatically control those
settings, you need to look into the LDT API.
Open \Program Files\Land Desktop 2005\Help\landauto-reference.chm
Check out the Object Model, specifically the DatabasePreferences object.
It's a routine that reacts to PLOT. We use psltscale set to 1 and ltscale set to 1 when we have mutiple viewports with mutiple scales. That way our line types come out right.
I wrote this to solve the problem you are having...it saves me from having
to start LDD just to change the DIMSCALE and make it stick. It sets LDD's
scale as well as the current DIMSCALE.
;;;grabs the AEC dict that contains the LDD scale and sets it to current
DIMSCALE
(defun c:dimscale (/ a b dimscale)
(defun dxf (code elist) (cdr (assoc code elist)))
(setq a (dictsearch (namedobjdict) "AEC_VARS"))
(if a
(progn
(setq b (dictnext (dxf -1 a) t))
(while (not (= (dxf 0 b) "AEC_VARS_DWG_SETUP"))
(setq b (dictnext (dxf -1 a)))
)
(setq
dimscale (getreal (strcat "\nEnter new value for DIMSCALE <"
(rtos (dxf 40 b))
">: "
)
)
)
(if (not dimscale)
(setq dimscale (dxf 40 b))
)
(setq b (entmod (subst (cons 40 dimscale) (assoc 40 b) b)))
)
(progn
(setq
dimscale (getreal (strcat "\nEnter new value for DIMSCALE <"
(rtos (getvar "dimscale"))
">: "
)
)
)
(if (not dimscale)
(setq dimscale (getvar "dimscale"))
)
)
)
(setvar "dimscale" dimscale)
(princ)
)
"Tomdum" <nospam@address.withheld> wrote in message
news:17859474.1103671618600.JavaMail.jive@jiveforu m1.autodesk.com...
scale goes back to what it was in Project>Drawing Setup...How can I change LDD drawing scale using lisp? Changing "ltscale" and
"dimscale" isn't working. It seems like after I call a LDD function the
Anyone?
Thanks,
Tom
You should use the DatabaseScale property of the DatabasePreferences object of
the ActiveDocument object of the ActiveProject object of the current
AeccApplication.
You probably need to study the landauto-reference.chm help file.
Now I could give you a copy of my dictionary method that Josh suggested, but
you'd be better off learning ActiveX methods.
--
John Uhden, Cadlantic
<the e-mail address is bogus>
http://www.cadlantic.com
Sea Girt, NJ
"Tomdum" <nospam@address.withheld> wrote in message
news:17859474.1103671618600.JavaMail.jive@jiveforu m1.autodesk.com...
goes back to what it was in Project>Drawing Setup...How can I change LDD drawing scale using lisp? Changing "ltscale" and
"dimscale" isn't working. It seems like after I call a LDD function the scale
Anyone?
Thanks,
Tom
Thanks, That's what I was looking for.
Tom
Newbie: Autocad 2002 - Sudden change in drawing scale
Scale without change the dimension text.