Help writing a Lisp...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I believe it's possible, but I'm not sure how to do it myself...
I'd like a lisp that I'll use for closeout packages, ideally it would be 1 command to
1) open dwg
2) use viewvis lisp (viewvis, ON)
3) switch to model space
4) hatchback
5)texttofront, all
Once I open all 25-ish drawings, 1 at a time, I would then publish to a single, multipage PDF file.
Thanks,
This is the viewvis lisp I use
(vl-load-com)
(defun C:viewvis (/ vlist yesno targetvp i maxvp)
(setq i 0)
(initget "ON OFF")
(setq yesno (cond ((getkword "\nTurn all viewports on or off? [ON/OFF] <ON>: ")) ("ON")))
(setq maxvp (getvar "maxactvp"))
(setvar "maxactvp" 2)
(while (and (/= i (length (layoutlist))) (/= (getvar "dwgname") drawingrefresh))
(setvar "ctab" (nth i (layoutlist)))
(setq i (1+ i))
)
(setq drawingrefresh (getvar "dwgname"))
(setq vlist (ssget "x" (list '(0 . "viewport") '(-4 . "/=") '(69 . 1))))
(while (/= 0 (sslength vlist))
(setq targetvp (vlax-ename->vla-object (ssname vlist 0)))
(if (= yesno "ON")
(vla-display targetvp :vlax-true)
(vla-display targetvp :vlax-false)
)
(ssdel (ssname vlist 0) vlist)
)
(setvar "maxactvp" maxvp)
(princ)
)