Lisp help - lts before plot

Lisp help - lts before plot

M_c3d
Advisor Advisor
473 Views
4 Replies
Message 1 of 5

Lisp help - lts before plot

M_c3d
Advisor
Advisor

I'm trying to write a lisp to set the lts to 1 before plotting;

(command "_.undefine" "Plot")
(defun C:Plot () (ltscale;1;) (command "_.Plot"))
 
It does the lts part properly, but it says unknown command "PLOT"

Any ideas what I'm doing wrong? or if this is at all possible?

Thanks,

0 Likes
Accepted solutions (2)
474 Views
4 Replies
Replies (4)
Message 2 of 5

dbroad
Mentor
Mentor
Accepted solution

I'm surprised anything about that code works.  Try starting vlide at the command line.  Then paste your code into a new window.  Notice how the sem-colons comment out the code?

 

There is no ltscale lisp function.  Everything after the first semicolon is ignored.

 

Try:

(command "_.undefine" "Plot")
(defun C:Plot () 
  (setvar "ltscale" 1) 
  (command "_.Plot")
)

You can only use semi-colons in menu macros.

Architect, Registered NC, VA, SC, & GA.
Message 3 of 5

M_c3d
Advisor
Advisor

Lisps aren't my strong point, so I appreciate your help on this.  I'm also surprised any of my previous attempt worked!  It was a modification of a previous lisp.

 

It works perfectly, I've added in (initdia) to get the plot dialog up

 

(command "_.undefine" "Plot") (defun C:Plot () (setvar "ltscale" 1)  (initdia) (command "_.Plot") )

 

Is it possible to add a regenall into it after the "ltscale" 1 to get it to update the display (it plots fine)

0 Likes
Message 4 of 5

M_c3d
Advisor
Advisor
Accepted solution

Copied your logic and added (Command "regenall") to before the (initdia) and it works perfectly.

 

Thanks for your help

0 Likes
Message 5 of 5

dbroad
Mentor
Mentor

Glad it worked for you.  I have my own plot redefinition function but it doesn't focus on ltscale. Rather it flags me if any xref needs reloading or is unable to be loaded.  Generally I keep LTSCALE, PSLTSCALE, and MSLTSCALE set to 1 so there is never a need to check them.  Sometimes though, I get annoyed with how picky it is and override my own command redefinition by entering .plot. I always plot to a PDF rather than to an actual printer so there is usually a cycle of plot, review, repeat until all(hopefully) the kinks are out.

Architect, Registered NC, VA, SC, & GA.
0 Likes