Search the Community
Showing results for tags 'combine'.
-
All, I need some help with this PDF plot lisp that was created at work, this lisp was created to take material list sheets PDF them and drop them into the source folder with the sheet name as the file name. I was wondering if someone could help figure out how to combine the pages together to create one file once they are converted to PDF all as one step. ;;;This is the lisp routine to Plot the material list to individual PDF files with the job name and the page number ;;;as is does in the Plot Material List button. ;;; plotpdf.lsp (defun c:PlotPDF (/ 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" "acad.ctb" "yes" "As Displayed" (strcat dir "ML-" (itoa cnt) "-"(getvar "dwgname")) "no" "yes" "yes" "yes") (command ".delay" "750") ) ) (princ "\nNo Blocks Selected: ") )(princ) ) Thanks, Brian
-
I am using ACAD 2013. I am new to using lsp files. Is it possible to combine 3 lsp routines that I regularly run to prepare files for a different software program? Is it possible to use the combined lsp routine to batch process multiple files in a folder? Is it possible to modify the 1st code to open the new file automatically? ;changes layout to model space, appends filename, option to open new file (defun c:L2M ( / BASE LST OLD_DIA) (setq old_dia (getvar 'FILEDIA) base (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME))) ) (setvar 'FILEDIA 1) (setq lst (layoutlist)) (foreach l lst (command "_.ctab" l "exportlayout" (strcat base "-" l) ) ) (setvar 'FILEDIA old_dia) (princ) ) ;Sets linework to by layer, layers to color 7 white, detaches external references (defun c:set7 () (setq uecho (getvar "cmdecho")) (setvar "cmdecho" 0) (command "setbylayer" "al" "" "n" "y") (command "-layer" "c" "7" "*") (command "-xref" "d" "*") (setvar "cmdecho" uecho) (princ) ) ;Justify text (defun c:BL (justify title / ss) (princ (strcat "\nSelect *Text to " title " justify: ")) (if (setq ss (ssget "_:L" '((0 . "ATTDEF,MTEXT,TEXT")))) (command "_.justifytext" ss "" justify) ) (princ) ) (defun c:JL (/) (_justifyIt "_ML" "Middle Left")) (defun c:JC (/) (_justifyIt "_MC" "Middle Center")) (defun c:JR (/) (_justifyIt "_MR" "Middle Right")) (defun c:BL (/) (_justifyIt "_BL" "Bottom Left")) (defun c:BC (/) (_justifyIt "_BC" "Bottom Center")) (defun c:BR (/) (_justifyIt "_BR" "Bottom Right")) (defun c:TL (/) (_justifyIt "_TL" "Top Left")) (defun c:TC (/) (_justifyIt "_TC" "Top Center")) (defun c:TR (/) (_justifyIt "_TR" "Top Right")) I don't know who the code authors are to give credit.
-
Maybe I'm just too new at the LISP thing but I've been through many forums and nothing really seems to spell it out for the layman, i.e. me. My company seems rather fresh to LISP as well but they have one "master" list of lisps they have used for some time. This list is loaded in everyone's CAD. I have several others that I have found that I would like to add to this master list but I don't see how they are separated and loaded. The idea is to update this master list with new commands and have others be able to simply have them available the next time CAD is started up again when the original lisp is loaded. Is there a quickie routine that loads other locations? I was given this style of line and told it would do such a thing but I must still be doing something wrong (load "brkblk") (load "BreakObjects18") (load "CCC") (load "Copy2DrawingsV1-2") (load "Copy2LayoutsV1-1") (load "DoubleOffsetV1-1") (load "Dynamic-Offset") (load "MCOPY") (load "QuickDimAligned-QDA") (load "ROT2ENT") (princ (load "BreakObjects18" "\nBreakObjects18.LSP file not loaded..")) (princ (load "CCC" "\nCCC.LSP file not loaded..")) (princ (load "Copy2DrawingsV1-2" "\nCopy2DrawingsV1-2.LSP file not loaded..")) (princ (load "Copy2LayoutsV1-1" "\nCopy2LayoutsV1-1.LSP file not loaded..")) (princ (load "DoubleOffsetV1-1" "\nDoubleOffsetV1-1.LSP file not loaded..")) (princ (load "Dynamic-Offset" "\nDynamic-Offset.LSP file not loaded..")) (princ (load "MCOPY" "\nMCOPY.LSP file not loaded...")) (princ (load "QuickDimAligned-QDA" "\nQuickDimAligned-QDA.LSP file not loaded...")) (princ (load "ROT2ENT" "\nROT2ENT.LSP file not loaded...")) Thanks for the patience, -Nobull
-
Combine several separate drawings into one multi-tab drawing? Help!!
ILoveMadoka posted a topic in AutoCAD Drawing Management & Output
I have 10 separate drawing files that I want to combine into one drawing and I want each drawing to be on a separate layout. I want to end up with one drawing with 10 layout tabs each containing the graphics from one drawing. Each drawing has one layout with the graphics on it. No fancy paper space / model space stuff. No viewport scaling. I thought this could be done via Design Center but I've never used that. I'm looking for input on the quickest way to achieve this. I may have to do this over and over. Please advise (and instruct) Thanks..- 6 replies
-
- design center
- combine
-
(and 1 more)
Tagged with:
-
Hi All, I need some help i have three lisp routines that i would like to combine into one routine. they all use the same objects to get their results so i was wondering if there was a way to combine them together. the order of would be as follows: 1. olo (Offset Polylines) 2. exl (Extrusion Lengths) the only that i see with this one is that it requires use input for placement, i would for it to place the results to the outside of lines. run the lisp routine by creating a rectangle exploded to see what it does. 3. pte (Panel Tab Extension) They all run perfectly by themselves, but im just trying to speed up the process. Here are the codes that i'm using. any help would be appreciated. Thanks, Brian ;| OFFSET POLYLINES [email="mfuccaro@hotmail.com"]mfuccaro@hotmail.com[/email] September 2003 |; (defun c:olo( / plines ; selection set of polylines ext ; extrnal point dist ; distance to offset poly ; a polyline from plines plist ; the list of poly del ; polyline to delete int ; internal point i) (command "undo" "begin") (princ "select polylines") (setq plines (ssget) i 0 ext (getvar "limmax") dist (getdist (strcat "distance <" (if olddist (rtos olddist) ;use old value as default "") ">"))) (if (not dist) (setq dist olddist)) ;reuse old distance if user press <Enter> (repeat (sslength plines) (setq poly (ssname plines i)) (setq plist (entget poly)) (command "offset" dist poly ext "") (setq del (entlast) int (polar (cdr (assoc 10 (entget del))) (angle (cdr (assoc 10 (entget del))) (cdr (assoc 10 plist))) (* 2 (distance (cdr (assoc 10 plist)) (cdr (assoc 10 (entget del))))))) (command "offset" dist poly int "") (command "_.change" (entlast) "" "_p" "_la" (getvar 'clayer) "") (entdel del) (setq i (1+ i))) (command "undo" "end") (setq olddist dist) ;preserve current distance for next run (princ) ) ;Extrusion Length (defun c:EXTL (/ cEnt tStr tBox tHgt tWid gr sPt cPt lAng bPt tPt pt1 pt2 pt3 pt4) (vl-load-com) (if (and (setq cEnt (car (entsel "\nSelect Object: "))) (member (cdr (assoc 0 (entget cEnt))) '("LWPOLYLINE" "POLYLINE" "LINE"))) (progn (setq tStr (strcat "1@" (rtos (- (vla-get-length (vlax-ename->vla-object cEnt)) 4.0)) (strcat "''")) tBox (textbox (list (cons 1 tStr) (cons 40 (getvar "TEXTSIZE")))) tHgt (- (cadadr tBox) (cadar tBox)) twid (- (caadr tBox) (caar tBox))) (princ "\nPosition Text...") (while (eq 5 (car (setq gr (grread t 5 0)))) (redraw) (if (listp (setq sPt (cadr gr))) (progn (setq cPt (vlax-curve-getClosestPointto cEnt sPt) lAng (angle cPt sPt) bpt (polar cPt lAng (/ (getvar "TEXTSIZE") 2.)) tpt (polar bpt lAng tHgt) mPt (polar bPt lAng (/ tHgt 2.)) pt1 (polar bpt (+ lAng (/ pi 2.)) (/ tWid 2.)) pt2 (polar bPt (- lAng (/ pi 2.)) (/ tWid 2.)) pt3 (polar tpt (+ lAng (/ pi 2.)) (/ tWid 2.)) pt4 (polar tPt (- lAng (/ pi 2.)) (/ tWid 2.))) (grvecs (list -3 pt1 pt2 pt3 pt4 pt1 pt3 pt2 pt4))))) (if (eq 3 (car gr)) (progn (setq lAng (- lAng (/ pi 2.))) (cond ((and (> lAng (/ pi 2)) (<= lAng pi)) (setq lAng (- lAng pi))) ((and (> lAng pi) (<= lAng (/ (* 3 pi) 2))) (setq lAng (+ lAng pi)))) (Make_Text mPt tStr lAng)))) (princ "\n<!> Incorrect Selection <!>")) (redraw) (princ)) (defun Make_Text (pt val rot) (entmake (list (cons 0 "TEXT") (cons 8 (getvar "CLAYER")) (cons 62 1) (cons 10 pt) (cons 40 (getvar "TEXTSIZE")) (cons 1 val) (cons 50 rot) (cons 7 (getvar "TEXTSTYLE")) (cons 71 0) (cons 72 1) (cons 73 2) (cons 11 pt)))) ;;; PANEL TAB EXTENSIONS (defun c:PTE(/ lSet actDoc lDel doMode objLst) (vl-load-com) (princ "\n>>> Select lines to extend/reduce <<< ") (if (and (setq lSet (ssget '((0 . "LINE")))); (setq lDel (getreal "\nSpecify : ")) ); end and (progn (initget 1 "Positive Negative Both") (setq doMode (getkword "\nSpecify direction [Positive/Negative/Both]: ") objLst(mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr(ssnamex lSet))))); end setq (vla-StartUndoMark (setq actDoc (vla-get-ActiveDocument (vlax-get-acad-object)))); end vla-StartUndoMark (if(member doMode '("Negative" "Both")) (foreach ln objLst (vlax-put ln 'startpoint (polar (vlax-get ln 'startpoint) (vlax-get ln 'angle)(- lDel))); end vlax-put ); end foreach ); end if (if(member doMode '("Positive" "Both")) (foreach ln objLst (vlax-put ln 'endpoint (polar (vlax-get ln 'endpoint) (vlax-get ln 'angle)lDel)) ); end foreach ); end if (vla-EndUndoMark actDoc) ); end progn ); end if (princ) )
-
- polylines.
- offset
-
(and 3 more)
Tagged with: