rcb007 Posted January 26, 2023 Posted January 26, 2023 I am trying to understand how to write this routine instead of creating several small basic routines. For an example, I want to be able to ask the user what scale would you like, then it would adjust the cannoscale variable and then the zoom scale variable. Currently, I use a lot of DCLs with Buttons that the users select what scale they want and then it would run that specific routine for that scale. (defun C:Demo_Set_Scale_Annotation () (command "_layout" "set" "") (comamnd "mspace") (command "_.cannoscale" "1\" = 50'") (command "_.zoom" "scale" "1/50xp") (command "pspace") (command "_.zoom" "extents") (princ) ) Thank you for any help and advise. Quote
BIGAL Posted January 26, 2023 Posted January 26, 2023 (edited) A couple of simple changes. (setq val (getint "\nNew scale - Enter = 50 ")) (if (= val nil) (setq val 50)) (command "_.cannoscale" (strcat "1\" =" (rtos val 2 0) "'")) (command "_.zoom" "scale" (strcat "1/" (rtos val 2 0) "xp")) version 2 this will pop a dcl without you doing any code. (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (setq ans (atoi (ah:butts 3 "V" '("Choose a scale" "10" "20" "50" "100" "200" "250" "500" )))) ; ans holds the button picked as an integer value Multi radio buttons.lsp Edited January 26, 2023 by BIGAL 2 Quote
mhupp Posted January 27, 2023 Posted January 27, 2023 (edited) Have to multiply val by 12 to get the correct scale factor of 1/600xp = 1:50' (command "_.zoom" "scale" (strcat "1/" (rtos (* val 12.0) 2 0) "xp")) Edited January 27, 2023 by mhupp Quote
rcb007 Posted January 27, 2023 Author Posted January 27, 2023 Thank you for the help. I can see the relationship by using the variable rather than the other way around. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.