Message 1 of 3
LISP to Select Dynamic Blocks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I picked up this lisp on the forum. can this plot lisp be modified to select a dynamic block or both? I've tried and failed miserably.
(vl-load-com) (defun c:unitPDF ( / *error* ss ed obj i box ll ur pt1 pt2 pdffile tag val) (defun *error* (errmsg) (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break")) (princ (strcat "\nError: " errmsg))) ;;;;; Do stuff then error, ESC, (mapcar 'setvar VarList OldVars) (setvar "CMDECHO" 1) (princ) );;;; end *error* ;;;;; Main routine (setvar "CMDECHO" 0) (setq logname (getvar "loginname")) (command "psetupin" "Details.dwg" "11x17 Landscape" "y") (command "-PLOT" "n" "model" "11x17 Landscape" "Bluebeam BW.pc3" "N" "Y" "N") (setq ss (ssget (list '(0 . "INSERT")'(2 . "UNITS")))) (if ss (progn (setq i 0) (while (< i (sslength ss)) (setq ent (ssname ss i) obj (vlax-ename->vla-object ent) box (vlax-invoke-method obj 'getboundingbox 'pt1 'pt2) ll (vlax-safearray->list pt1) ur (vlax-safearray->list pt2) ) (while (and (setq ent (entnext ent)) (= "ATTRIB" (cdr (assoc 0 (setq edata (entget ent))))) ) (setq tag (cdr (assoc 2 edata))) (setq val (cdr (assoc 1 edata))) (cond ((= tag "-DO-NOT-EDIT-") (setq SHEET1 val)) ) ) (setq pdffile (strcat "C:/Documents and Settings/" (getvar 'loginname) "/desktop/PDF/" SHEET1 ".pdf" ) ) (command "-export" "_P" "_W" ll ur "_N" pdffile) (setq i (1+ i)) ) ) ) (setvar "CMDECHO" 1) (princ) )