Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

View, Window, Save command in LISP

1 REPLY 1
SOLVED
Reply
Message 1 of 2
dmfrazier
951 Views, 1 Reply

View, Window, Save command in LISP

AutoCAD 2010.

When I try something like the following:

 

(setq pt1 (getpoint))

(setq pt2 (getpoint))

(command "VIEW" "W" "MyView" !pt1 !pt2)

 

..."nil" appears on the command line, and no view is saved.  (And it doesn't seem to matter what form of the VIEW command I use.)

 

However, if I set the two variables, and then use them in the command-line VIEW command, like so:

 

Command: -view
Enter an option [?/Delete/Orthographic/Restore/Save/sEttings/Window]: w
Enter view name to save: MyView

Specify first corner: !pt1
(9.66774 -0.845631 0.0)
Specify opposite corner: !pt2
(29.8391 8.49791 0.0)

 

...it works fine.

 

Can anyone tell me what I'm doing wrong?

 

1 REPLY 1
Message 2 of 2
dmfrazier
in reply to: dmfrazier

Note to self: you don't need the exclamation point (evaluate the variable) inside the LISP command function.

Thanks to anyone who would have responded.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost