| Author |
Message |
Tomdum
Guest
|
Posted:
Wed Dec 22, 2004 4:26 am Post subject:
How can I change LDD drawing scale using lisp? |
|
|
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
|
|
| Back to top |
|
 |
Walt Engle
Guest
|
Posted:
Wed Dec 22, 2004 4:32 am Post subject:
Re: How can I change LDD drawing scale using lisp? |
|
|
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. |
|
| Back to top |
|
 |
R.K. McSwain
Guest
|
Posted:
Wed Dec 22, 2004 4:46 am Post subject:
Re: How can I change LDD drawing scale using lisp? |
|
|
Tomdum wrote:
| Quote: | 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
|
Why do you want it different than what you specify in "Drawing Setup"?
------------
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.
|
|
| Back to top |
|
 |
Tomdum
Guest
|
Posted:
Wed Dec 22, 2004 5:04 am Post subject:
Re: How can I change LDD drawing scale using lisp? |
|
|
| 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. |
|
| Back to top |
|
 |
Josh
Guest
|
Posted:
Wed Dec 22, 2004 5:48 am Post subject:
Re: How can I change LDD drawing scale using lisp? |
|
|
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@jiveforum1.autodesk.com...
| Quote: | 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...
| Quote: | Anyone?
Thanks,
Tom |
|
|
| Back to top |
|
 |
John Uhden
Guest
|
Posted:
Wed Dec 22, 2004 8:57 am Post subject:
Re: How can I change LDD drawing scale using lisp? |
|
|
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@jiveforum1.autodesk.com...
| Quote: | 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...
| Quote: | Anyone?
Thanks,
Tom |
|
|
| Back to top |
|
 |
Tomdum
Guest
|
Posted:
Thu Dec 23, 2004 12:42 am Post subject:
Re: How can I change LDD drawing scale using lisp? |
|
|
Thanks, That's what I was looking for.
Tom |
|
| Back to top |
|
 |
|
|
|
|