Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-07-07, 10:45 PM   #1
mpsmith00
Member
 
Join Date: 2003-02
Posts: 3
mpsmith00 is starting their journey
Angry Can't pass the limits

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
mpsmith00 is offline   Reply With Quote
Old 2004-07-07, 10:57 PM   #2
Coolmo
All AUGI, all the time
 
Coolmo's Avatar
 
Join Date: 2003-10
Posts: 525
Coolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightlyCoolmo is glowing brightly
Default RE: Can't pass the limits

Change this:

Quote:
(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..
__________________
COOLMO
If = 0 then
End If
Coolmo is offline   Reply With Quote
Old 2004-07-07, 11:37 PM   #3
mpsmith00
Member
 
Join Date: 2003-02
Posts: 3
mpsmith00 is starting their journey
Thumbs up RE: Can't pass the limits

Thanks Got it to working!!! I knew it was easy just not that easy.
mpsmith00 is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT +1. The time now is 03:02 PM.