Message 1 of 5
-pan Lisp not doing anything
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In all transparency, I used Chatgpt to write most of this code. I've tried variation of this base of my search results and I am stuck.
I have multiple sheets that are identical and the viewport need to be panned over a specific amount to maintain consistency. While inside the viewport I use the -Pan command the for left & right is 1200inchs (or units) and up & down will be 1440 inchs (or units). I would like help where the command prompt asks which direction and the view inside the view port pans in the specific distance.
If anyone is up to adding the process of selecting a viewport, making the viewport active and unlocking if lock, then using the -pan command. 🙂
(defun c:mvp ()
(initget 1 "Up Down Left Right")
(setq direction (getkword "\nWhich direction? [Up/Down/Left/Right]: "))
(cond
((equal (strcase direction) "UP")
(command (list _.-PAN (trans '(0 1440 0) 0 1))))
((equal (strcase direction) "DOWN")
(command (list _.-PAN (trans '(0 -1440 0) 0 1))))
((equal (strcase direction) "LEFT")
(command (list _.-PAN (trans '(-1200 0 0) 0 1))))
((equal (strcase direction) "RIGHT")
(command (list _.-PAN (trans '(1200 0 0) 0 1))))
)
(princ)
)
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘