Search the Community
Showing results for tags 'save as default'.
-
Hello there! since you're so popular I need your help. Here is my code and I need it to generate PDF only for it's job, like I have 50 pages and actually what I have here selects one page block (reads it's entity) and generates all the 50 pages, but I need to get PDF from like 25 of them not all of them! it needs to PDF ALL AT ONCE, page by page (with PDF Factory Pro Printer) Here it is : (defun c:epdf (/ ob ss bn mn mx) (vl-load-com) (setq cnt 0) (setq dir (getvar "dwgprefix")) (if (and (progn (initget "B") (setq ob (entsel "\nSelect Block/B for blockname: ")) (cond ((eq ob "B") (setq bn (getstring "\nEtner Block Name: ")) ) ((and (eq (type ob) 'LIST) (vlax-method-applicable-p (vlax-ename->vla-object (car ob)) 'getboundingbox ) ) (setq bn (cdr (assoc 2 (entget (car ob))))) ) ) ) (tblsearch "BLOCK" bn) bn (setq ss (ssget "_X" (list '(0 . "INSERT") '(410 . "Model") (cons 2 bn)) ) ) ) (progn (vla-zoomextents (vlax-get-acad-object)) (repeat (setq i (sslength ss)) (setq ML "Material-List") (setq cnt (1+ cnt)) (vla-getboundingbox (vlax-ename->vla-object (ssname ss (setq i (1- i)))) 'mn 'mx ) (command "plot" "yes" "model" "DWG To PDF.pc3" "ANSI A (8.50 x 11.00 Inches)" "inches" "LANDSCAPE" "no" "Window" (trans (vlax-safearray->list mn) 0 1) (trans (vlax-safearray->list mx) 0 1) "fit" "center" "yes" "monochrome.ctb" "yes" "As Displayed" (strcat dir "ML-" (itoa cnt) "-" (getvar "dwgname")) "no" "yes" "yes" "yes" ) (command ".delay" "750") ) ) (princ "\nNo Blocks Selected: ") ) (princ) )
-
Lee Mac wrote this awesome lisp routine to be able to select multiple objects and wblock block them out as separate drawings, which works great. My problem i'm having is the program that i'm using for my router was written in 2010 and won't except the 2013 file's and for some reason wblock won't except the autocad default when i run the lisp routine, it saves them to 2013. I was wondering if someone could help me with this i would really appreciate it. Thanks again, Brian ;; WBlock Rectangles - Lee Mac ;; For improved performance, disable DWG thumbnail generation (defun c:wbr ( / app blk cpy dir doc dwg err in1 in2 llp lst mid obj org sel ssc sso tmp urp ) (setvar 'cmdecho 0) (if (setq sel (ssget "_:L" '((0 . "LWPOLYLINE")))) (progn (setq app (vlax-get-acad-object) doc (vla-get-activedocument app) ssc (vla-get-selectionsets doc) sso (vl-catch-all-apply 'vla-item (list ssc "wbr-sel")) org (vlax-3D-point 0 0) dir (getvar 'dwgprefix) ) (if (vl-catch-all-error-p sso) (setq sso (vla-add ssc "wbr-sel")) ) (vla-zoomextents app) (repeat (setq in1 (sslength sel)) (setq obj (vlax-ename->vla-object (ssname sel (setq in1 (1- in1))))) (vla-getboundingbox obj 'llp 'urp) (setq llp (vlax-safearray->list llp) urp (vlax-safearray->list urp) mid (vlax-3D-point (mapcar '(lambda ( a b ) (/ (+ a b) 2.0)) llp urp)) ) (vla-clear sso) (if (setq tmp (ssget "_C" (trans urp 0 1) (trans llp 0 1))) (progn (repeat (setq in2 (sslength tmp)) (setq cpy (vla-copy (vlax-ename->vla-object (ssname tmp (setq in2 (1- in2))))) lst (cons cpy lst) ) (vla-move cpy mid org) (if (= "AcDbText" (vla-get-objectname cpy)) (setq blk (vla-get-textstring cpy)) ) ) (cond ( (null blk)) ( (not (snvalid blk)) (princ (strcat "\nInvalid block name \"" blk "\".")) ) ( (findfile (setq dwg (strcat dir blk ".dwg"))) (princ (strcat "\n" dwg " already exists.")) ) ( (progn (vlax-invoke sso 'additems lst) (vl-catch-all-error-p (setq err (vl-catch-all-apply 'vla-wblock (list doc dwg sso)))) ) (princ (strcat "\nError creating drawing: " dwg "\nDetail: " (vl-catch-all-error-message err) ) ) ) ) (foreach obj lst (vla-delete obj)) (setq lst nil blk nil ) ) ) ) (vla-zoomprevious app) (vla-delete sso) ) (setvar 'cmdecho 1) ) (princ) ) (vl-load-com) (princ)