chulse Posted August 7, 2009 Posted August 7, 2009 Forgive me - I am a complete lisp noob... I have tried to set CANNOSCALE with lisp but I keep getting errors. I have tried using (command "cannoscale" "1\" = 25'") and (setvar "cannoscale" "1\" = 25'") but neither seem to work. The scale is in the dwg already. Help please? Quote
chulse Posted August 7, 2009 Author Posted August 7, 2009 Nope - still says it can't do it. Thanks though Quote
The Buzzard Posted August 7, 2009 Posted August 7, 2009 Nope - still says it can't do it. Thanks though Is it available in the Scale List? Quote
The Buzzard Posted August 7, 2009 Posted August 7, 2009 yesit's in the list as 1" = 25' I went directly to setvar and I guess it assumes it a string. Command: setvar Enter variable name or [?] : Enter new value for CANNOSCALE, or . for none : Had no problem with this, But it cannot be written the way you have it. Not sure. Quote
The Buzzard Posted August 7, 2009 Posted August 7, 2009 I went directly to setvar and I guess it assumes it a string. Command: setvar Enter variable name or [?] : Enter new value for CANNOSCALE, or . for none : Had no problem with this, But it cannot be written the way you have it. Not sure. I just tried this: Command: SETVAR Enter variable name or [?] : Enter new value for CANNOSCALE, or . for none : Command: (setvar "cannoscale" "1\" = 25'") "1\" = 25'" Did not get an Invalid responce. Quote
The Buzzard Posted August 7, 2009 Posted August 7, 2009 1" = 25' The strange thing is, I could not delete it from the list. I do not understand why. The delete button will not activate for this scale only. Quote
alanjt Posted August 8, 2009 Posted August 8, 2009 1" = 25' The strange thing is, I could not delete it from the list. I do not understand why. The delete button will not activate for this scale only. probably have, either an object or viewport, associated with the scale. Quote
alanjt Posted August 8, 2009 Posted August 8, 2009 you should be able to set it fine (with setvar): Command: (setvar "cannoscale" "1\" = 20'")"1\" = 20'" Quote
The Buzzard Posted August 8, 2009 Posted August 8, 2009 probably have, either an object or viewport, associated with the scale. I am in model space in a new drawing with nothing in the drawing editor. I created the scale new. It will not delete. There are no viewports. Quote
alanjt Posted August 8, 2009 Posted August 8, 2009 I am in model space in a new drawing with nothing in the drawing editor. I created the scale new. It will not delete. There are no viewports. how bizarre. i just created a custom scale, closed, set it as current, then set a different scale as current and was able to delete it just fine. hmm Quote
chulse Posted August 10, 2009 Author Posted August 10, 2009 I just tried this: Command: SETVAR Enter variable name or [?] : Enter new value for CANNOSCALE, or . for none : Command: (setvar "cannoscale" "1\" = 25'") "1\" = 25'" Did not get an Invalid responce. Was this direct on the command line or embedded in a lisp? It works fine for me on the command line, but not in the lisp... Could it be something else with the lisp? Quote
Lee Mac Posted August 10, 2009 Posted August 10, 2009 Anything that works on the command line would work in a LISP, so one would have to assume that it is something other than this that is causing your LISP to fail. Lee Quote
chulse Posted August 10, 2009 Author Posted August 10, 2009 This is how I have it in context. Any thoughts? (defun c:svp ( / ss) (progn (command "_mspace"_) (setq ss (ssget)) (command "_ucs" "_object" ss) (command "_plan" "_current") (command "_zoom" "c" "0,0" "180") (setvar "cannoscale" "1\" = 25'") (command "regenall") ) );;defun Quote
Lee Mac Posted August 10, 2009 Posted August 10, 2009 Try this Chulse: (defun c:svp (/ ss) (if (zerop (getvar "TILEMODE")) (command "_.mspace")) (if (setq ss (ssget)) (progn (command "_.ucs" "_object" ss) (command "_.plan" "_current") (command "_.zoom" "c" "0,0" "180") (setvar "CANNOSCALE" "1\" = 25'") (command "_.regenall"))) (princ)) You had an error in your "mspace" command. Also, you cannot invoke the mspace command whilst in ModelSpace. And, you should allow for an empty selectionset. Lee Quote
chulse Posted August 10, 2009 Author Posted August 10, 2009 Thanks for the suggestions. The rest of the code works great, but this still does not work: (setvar "CANNOSCALE" "1\" = 25'") it seems like it is just ignoring it now - no error on the command line... Quote
chulse Posted August 12, 2009 Author Posted August 12, 2009 Try this Chulse: (defun c:svp (/ ss) (if (zerop (getvar "TILEMODE")) (command "_.mspace")) (if (setq ss (ssget)) (progn (command "_.ucs" "_object" ss) (command "_.plan" "_current") (command "_.zoom" "c" "0,0" "180") (setvar "CANNOSCALE" "1\" = 25'") (command "_.regenall"))) (princ)) + You had an error in your "mspace" command. Also, you cannot invoke the mspace command whilst in ModelSpace. And, you should allow for an empty selectionset. Lee Lee, I meant to ask - why the "." before the command name? What does it mean? Thanks for all your help. I still can't get the cannoscale bit to work...even when I try it alone... Quote
Lee Mac Posted August 12, 2009 Posted August 12, 2009 Regarding prefixes for commands: " _" allows for other language versions. " . " uses the original command if it has been redefined by the user. Quote
chulse Posted August 12, 2009 Author Posted August 12, 2009 Awesome, thanks I might just learn lisp yet... with your help! 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.