Jump to content

Recommended Posts

Posted

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?

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • chulse

    8

  • The Buzzard

    6

  • Lee Mac

    4

  • alanjt

    3

Posted

Try

(setvar "cannoscale" "1 = 300")

Posted
Nope - still says it can't do it.

 

Thanks though

 

Is it available in the Scale List?

Posted
yes

it'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.

Posted
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.

Posted

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.

Posted
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.

Posted

you should be able to set it fine (with setvar):

 

Command: (setvar "cannoscale" "1\" = 20'")

"1\" = 20'"

Posted
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.

Posted
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

Posted
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?

Posted

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

Posted

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

Posted

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

Posted

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...

Posted
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...

Posted

Regarding prefixes for commands:

 

" _" allows for other language versions.

 

" . " uses the original command if it has been redefined by the user.

Posted

Awesome, thanks

 

I might just learn lisp yet... with your help!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...