PDA

View Full Version : Can't pass the limits



mpsmith00
2004-07-07, 08:45 PM
I am working on a quick lisp file to change the text size and limits by multiplying the dimscale. I can get the following variables but can't get my lisp routine to set limmax Here is what I got.

(defun c:slm (/ ds otxs ntxs dms oldx_val oldy_val x_val y_val)
(setq ds (getreal "\nEnter new dimscale: "))
(setvar "dimscale" ds)
(setq dms (getvar "dimscale"))
(setq oldx_val (car (getvar "limmax")))
(setq oldy_val (cadr (getvar "limmax")))
(setq otxs (getvar "textsize"))
(setq x_val (* oldx_val dms))
(setq y_val (* oldy_val dms))
(setq ntxs (* otxs dms))
(command "setvar" "textsize" ntxs)
(command "setvar" "limmax" x_val , y_val)
(princ)
)

Like I said it is a quick change. I have to update a lot of drawings and all info is in model space and the Engineer want's it to stay that way.

Any help would be greatly appreciated

Coolmo
2004-07-07, 08:57 PM
Change this:


(command "setvar" "limmax" x_val , y_val)
to this:

(command "setvar" "limmax" (list x_val y_val))

You have to put the two variables together to form a list or XY coordinate value before you can pass it to the "limmax" command. Simply adding a comma between the defined x_val and y_val variables doesn't work.

Example:

(setq X 3) ;;sets X equal to 3
(setq Y 5) ;;sets Y equal to 5
(setq XYPNT (list X Y)) ;; uses the LIST method to return the value "(X Y)" which can be used as an X/Y coordinate in space.

Hope this helps..8)

mpsmith00
2004-07-07, 09:37 PM
Thanks Got it to working!!! I knew it was easy just not that easy.