Jump to content

Recommended Posts

Posted

hello,
I want to make the following list selection.
For example, when you enter the command, page size, scale, plot style etc. can you help? Batch to create pdf in one go.

(vl-load-com)
(defun c:plot_pdf (/ bas dwg file hnd i len llpt lst mn mx ss tab urpt)
(if (setq ss (ssget "_X" '((0 . "INSERT") (2 . "SHEET"))))
(progn
(repeat (setq i (sslength ss))
(setq hnd (ssname ss (setq i (1- i)))
tab (cdr (assoc 410 (entget hnd)))
bas (cdr (assoc 10 (entget hnd))) ; get insert base point
lst (cons (cons tab (cons bas hnd)) lst) ; include insert base point
)
)
; (setq lst (vl-sort lst '(lambda (x y) (> (car x) (car y)))))
; sort by blocks insert base point x ascending = from left right
(setq lst (vl-sort lst '(lambda (x y) (> (car (cadr y)) (car (cadr x))))))
; sort by blocks insert base point y descending = from top down
(setq lst (vl-sort lst '(lambda (x y) (< (cadr (cadr y)) (cadr (cadr x))))))
(setq i 0)
(foreach x lst
(setq file (strcat (getvar 'DWGPREFIX)
(substr (setq dwg (getvar 'DWGNAME)) 1 (- (strlen dwg) 4))
"-"
(itoa (setq i (1+ i)))
".pdf"
)
)
(if (findfile file)
(vl-file-delete file)
)
; (vla-getboundingbox (vlax-ename->vla-object (cdr x)) 'mn 'mx)
(vla-getboundingbox (vlax-ename->vla-object (cddr x)) 'mn 'mx)
(setq llpt (vlax-safearray->list mn)
urpt (vlax-safearray->list mx)
len (distance llpt (list (car urpt) (cadr llpt)))
)
(command "-plot"
"yes"
(car x)
"DWG TO PDF.PC3"
; "ISO A3 (420.00 x 297.00 MM)"
; "ISO A1 (841.00 x 594.00 MM)"
"ISO full bleed A4 (297.00 x 210.00 MM)"
"Millimeters"
"Portrait"
"No"
"Window"
llpt
urpt
"Fit"
; "1:10"
"Center"
"yes"
; "grayscale.ctb"
; "Screening 75%.ctb"
"monochrome.ctb"
"yes"
""
)
(if (/= (car x) "Model")
(command "No" "No" file "no" "Yes") ; pspace
(command file "no" "Yes") ; model
)
)
)
)
(princ)
)

Posted

I use Plot to Layout in all Page Setups for plotting and have a second Page Setup for PDF for each of them.

Need functional Page Setups for Publishing anyway.

Have QuickPlot & QuickPDF macros to quickly plot any layout without any other input.

 

Nothing reduces drawing time better than good templates!

  • Like 1
Posted (edited)

So you plotting from Model space or layout ? 

 

Google "plotting Maratovich" has a good package handles lots of combinations.

 

I have plot range etc of layouts of different sizes but not model, only have plot all in model but 1 size.

 

Big hint use layouts.

Edited by BIGAL
  • Like 2
Posted

no, all my pages will be pdf the ones with block references are in the model

Posted

What I did with my plotting LISPs was to set each option in the plot command line as a variable in the LISP.. Before the LISP gets to the plot command, I ran sub routines to work out what each of these variables should be, some of course are fixed and the routine is a simple "(defun continuewithplot  ( / return) (setq return "Yes") return )' type of thing. Others need some working out.

 

That way I can make up the main routine that works and if necessary at a later date adjust these sub routines to suit what I need to do

 

In your case you might for example create a variable MyPageSize and get that worked out earlier in the LISP... and suddenly what you need to do becomes simpler.

 

So you might do a search "how to get CAD pagesize - see if there is something out there that will give you say "A4" or the page coordinates. After that you can make a lookup table for your pages, if the paper size is A4 set MyPageSize "ISO full bleed A4 (297.00 x 210.00 MM)" - if that makes sense,.

 

 

      (command "-plot"
        "yes"
        (car x)
        "DWG TO PDF.PC3"
MyPageSize
        "Millimeters"
        "Portrait"
        "No"
        "Window"
        llpt
        urpt
MyScale
        "Center"
        "yes"
MyCtb
      "yes"
      ""
   )

 

 

A lot of this could be on the internet with an easy search.

 

Hope this makes sense - ask if you need more details (my plotting LISP is quite long, lots in there to check all the referenced routines and so on work, but little parts I can copy to here)

Posted (edited)

Like Steven P look for certain blocks, get their scale so you can set a window of length and height. You can get insertion point and for title blocks was lower left. Then use a plot window with correct scale.

 

something like this designed for layout use.

(cond 
((=  blkname "TITLE_BLOCK_A0_V4" )(setq sc "1=1" psize "ISO full bleed A1 (841.00 x 1189.00 MM)" ll "-6,-6" ur "1175,837" orien "Landscape"))
((=  blkname "TITLE_BLOCK_A1_V4" )(setq sc "1=1" psize "ISO full bleed A1 (594.00 x 841.00 MM)" ll "-6,-6" ur "837,590" orien "Landscape"))
((=  blkname "TITLE_BLOCK_A1PORT_V4" )(setq sc "1=1" psize "ISO full bleed A1 (594.00 x 841.00 MM)" ll "-6,-6" ur "577,823" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A2PORT_V4")(setq sc "1=1" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A3PORT_V4")(setq sc "1=1" psize "ISO expand A3 (297.00 x 420.00 MM)" ll "-3,-3" ur "280.4,403.5" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A4PORT_V4")(setq sc "1=1" psize "ISO full bleed A4 (210.00 x 297.00 MM)" ll "-6,-6" ur "206,293" orien "Portrait"))
((= blkname "TITLE_BLOCK_A1_V4")(setq sc "1=1" psize "ISO full bleed A1 (841.00 x 594.00 MM)" ll "-6,-6" ur "837,590" orien "Landscape"))
((= blkname "TITLE_BLOCK_A2_V3")(setq sc "1=1" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((= blkname "TITLE_BLOCK_A3_V4")(setq sc "1=1" psize "ISO full bleed A3 (420.00 x 297.00 MM)" ll "-6,-6" ur "406.5,283.4" orien "Landscape"))
((= blkname "TITLE_BLOCK_A4_V4")(setq sc "1=1" psize "ISO full bleed A4 (297.00 x 210.00 MM)" ll "-6,-6" ur "293,206" orien "Landscape"))
)

 

Again I would reccomend use layouts so much easier for this problem, I had 88 layouts one dwg.

 

There is other code about making layouts like pick a point in model space and enter a scale and layout is made.

Edited by BIGAL
  • Like 2
Posted
On 1/27/2023 at 12:50 AM, BIGAL said:

Like Steven P look for certain blocks, get their scale so you can set a window of length and height. You can get insertion point and for title blocks was lower left. Then use a plot window with correct scale.

 

something like this designed for layout use.

(cond 
((=  blkname "TITLE_BLOCK_A0_V4" )(setq sc "1=1" psize "ISO full bleed A1 (841.00 x 1189.00 MM)" ll "-6,-6" ur "1175,837" orien "Landscape"))
((=  blkname "TITLE_BLOCK_A1_V4" )(setq sc "1=1" psize "ISO full bleed A1 (594.00 x 841.00 MM)" ll "-6,-6" ur "837,590" orien "Landscape"))
((=  blkname "TITLE_BLOCK_A1PORT_V4" )(setq sc "1=1" psize "ISO full bleed A1 (594.00 x 841.00 MM)" ll "-6,-6" ur "577,823" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A2PORT_V4")(setq sc "1=1" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A3PORT_V4")(setq sc "1=1" psize "ISO expand A3 (297.00 x 420.00 MM)" ll "-3,-3" ur "280.4,403.5" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A4PORT_V4")(setq sc "1=1" psize "ISO full bleed A4 (210.00 x 297.00 MM)" ll "-6,-6" ur "206,293" orien "Portrait"))
((= blkname "TITLE_BLOCK_A1_V4")(setq sc "1=1" psize "ISO full bleed A1 (841.00 x 594.00 MM)" ll "-6,-6" ur "837,590" orien "Landscape"))
((= blkname "TITLE_BLOCK_A2_V3")(setq sc "1=1" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((= blkname "TITLE_BLOCK_A3_V4")(setq sc "1=1" psize "ISO full bleed A3 (420.00 x 297.00 MM)" ll "-6,-6" ur "406.5,283.4" orien "Landscape"))
((= blkname "TITLE_BLOCK_A4_V4")(setq sc "1=1" psize "ISO full bleed A4 (297.00 x 210.00 MM)" ll "-6,-6" ur "293,206" orien "Landscape"))
)

 

Again I would reccomend use layouts so much easier for this problem, I had 88 layouts one dwg.

 

There is other code about making layouts like pick a point in model space and enter a scale and layout is made.

maybe we should select some general selections first, for example scale: 1:1/fit.. plot style table after selecting on the command line : monochrome, grayscale... drawing orientation: landscape, portrait.. then paper size block name so we can select all of them from the command line and proceed. so we have to add the features step by step.

Posted

We just had different pick plot button, but also had layouts only, pick button and watch sheets come out.

 

image.png.08ddea220d2e61a2b9f5f815c8737a20.png

  • Like 1
Posted

yes, this kind of selection progression actually makes sense. Do you have a sample lisp for this?

 

 

 

On 1/30/2023 at 3:03 AM, BIGAL said:

We just had different pick plot button, but also had layouts only, pick button and watch sheets come out.

 

image.png.08ddea220d2e61a2b9f5f815c8737a20.png

 

Posted

Ok first thing my preference is for using layouts not all in model space, so most of my code is written around that method.

 

The menu does as hinted above looks at title block in each layout and sets correct values. 

 

For pdf can do plot a range of layouts handy when you update say 1 or 2 sheets.

 

Last question do you know how to make a menu, that is a custom mnu say using notepad, as per image can have lots of stuff in a menu.

  • Like 1
Posted

 

All the pages I want to make pdf are in the model, but there are also layouts. My goal is to make a pdf of the pages I want, in the sizes I want, and with the features I want, by making a selection. (also by selecting and advancing when I start the command) I'm not very advanced in making menu, but I know what I can change when I look at it. I hope I was able to explain. Thanks for your return.

 

8 hours ago, BIGAL said:

Ok first thing my preference is for using layouts not all in model space, so most of my code is written around that method.

 

The menu does as hinted above looks at title block in each layout and sets correct values. 

 

For pdf can do plot a range of layouts handy when you update say 1 or 2 sheets.

 

Last question do you know how to make a menu, that is a custom mnu say using notepad, as per image can have lots of stuff in a menu.

 

 

 

image.png

Posted (edited)

There is lots of plot titles in model space examples if what you have in image is one title block but at different scales then just read the scale of the title block, you can work out from its insertion point the size of a plot window. If the different objects are different blocks then again same theory get scale but different sheet when plotting. 

 

We only plotted 1 size sheet, it would normally be an A1 sheet at true size but an A3 was the preferred is the same but with plot scale 1=2 so easy for those 2 sizes, we did plot A4 for std dwg sets. 

 

Working with say a company title block in layouts at plot scale 1=1 but with MVIEWS is just so much easier.

Edited by BIGAL
  • 1 month later...
Posted

 

hello, it's been a long time. but I want to complete this list. With their choices. and it also puts the pdfs in the current location where the dwg is, can I change this?

 

On 1/27/2023 at 12:50 AM, BIGAL said:

Like Steven P look for certain blocks, get their scale so you can set a window of length and height. You can get insertion point and for title blocks was lower left. Then use a plot window with correct scale.

 

something like this designed for layout use.

(cond 
((=  blkname "TITLE_BLOCK_A0_V4" )(setq sc "1=1" psize "ISO full bleed A1 (841.00 x 1189.00 MM)" ll "-6,-6" ur "1175,837" orien "Landscape"))
((=  blkname "TITLE_BLOCK_A1_V4" )(setq sc "1=1" psize "ISO full bleed A1 (594.00 x 841.00 MM)" ll "-6,-6" ur "837,590" orien "Landscape"))
((=  blkname "TITLE_BLOCK_A1PORT_V4" )(setq sc "1=1" psize "ISO full bleed A1 (594.00 x 841.00 MM)" ll "-6,-6" ur "577,823" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A2PORT_V4")(setq sc "1=1" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A3PORT_V4")(setq sc "1=1" psize "ISO expand A3 (297.00 x 420.00 MM)" ll "-3,-3" ur "280.4,403.5" orien "Portrait"))
((=  blkname "TITLE_BLOCK_A4PORT_V4")(setq sc "1=1" psize "ISO full bleed A4 (210.00 x 297.00 MM)" ll "-6,-6" ur "206,293" orien "Portrait"))
((= blkname "TITLE_BLOCK_A1_V4")(setq sc "1=1" psize "ISO full bleed A1 (841.00 x 594.00 MM)" ll "-6,-6" ur "837,590" orien "Landscape"))
((= blkname "TITLE_BLOCK_A2_V3")(setq sc "1=1" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((= blkname "TITLE_BLOCK_A3_V4")(setq sc "1=1" psize "ISO full bleed A3 (420.00 x 297.00 MM)" ll "-6,-6" ur "406.5,283.4" orien "Landscape"))
((= blkname "TITLE_BLOCK_A4_V4")(setq sc "1=1" psize "ISO full bleed A4 (297.00 x 210.00 MM)" ll "-6,-6" ur "293,206" orien "Landscape"))
)

 

Again I would reccomend use layouts so much easier for this problem, I had 88 layouts one dwg.

 

There is other code about making layouts like pick a point in model space and enter a scale and layout is made.

 

Posted

 

yes, in this way, I can choose the page size in the first place, then the scale status, and then the plot style table. If you want to share the lisp you have on layout, of course, I would like to take advantage of it. at least i adopt the path followed. Can you share.

 

On 1/30/2023 at 3:03 AM, BIGAL said:

We just had different pick plot button, but also had layouts only, pick button and watch sheets come out.

 

image.png.08ddea220d2e61a2b9f5f815c8737a20.png

 

Posted (edited)

If you break down the cond

 

((= blkname "TITLE_BLOCK_A0_V4" ) name of tilte block

(setq sc "1=1" sets plot scale

psize "ISO full bleed A1 (841.00 x 1189.00 MM)" sheet size

ll "-6,-6" lower left corner

ur "1175,837" upper right corner

orien "Landscape" oreintation is landscape

))

 

You need to set all the correct plot parameters.

 

This is used with

 

(COMMAND "-PLOT"  "Y"  "" "DWG To PDF"   psize "m" Orien  "N"  "W"  ll ur sc "C" "y" "XXX.ctb" "Y" "n" "n" "n" pdfName "N" "y")

 

So edit code above to correct sizes and post.

Edited by BIGAL
Posted

I tried to integrate it but it gives error: syntax error. I don't understand where it didn't match. like I defined my selection parameters.

 

 

(vl-load-com)
(defun c:plot_pdf (/ en ent sc obj bas dwg file hnd i len llpt lst mn mx ss tab urpt)
    (if (setq ss (ssget '((0 . "INSERT"))))
     (progn
            (repeat (setq i (sslength ss))
                (setq hnd (ssname ss (setq i (1- i)))
                      tab (cdr (assoc 410 (entget hnd)))
                      bas (cdr (assoc 10 (entget hnd))) ; get insert base point
                      lst (cons (cons tab (cons bas hnd)) lst) ; include insert base point
                )
            )
;            (setq lst (vl-sort lst '(lambda (x y) (> (car x) (car y)))))
            ; sort by blocks insert base point x ascending = from left right
            (setq lst (vl-sort lst '(lambda (x y) (> (car (cadr y))  (car (cadr x))))))
            ; sort by blocks insert base point y descending = from top down
            (setq lst (vl-sort lst '(lambda (x y) (< (cadr (cadr y)) (cadr (cadr x))))))
            (setq i 0)
            (foreach x lst
                (setq file (strcat (getvar 'DWGPREFIX)
                                   (substr (setq dwg (getvar 'DWGNAME)) 1 (- (strlen dwg) 4))
                                   "-"
                                   (itoa (setq i (1+ i)))
                                   ".pdf"
                           )
                )
                (if (findfile file)
                    (vl-file-delete file)
                )
;               (vla-getboundingbox (vlax-ename->vla-object (cdr x)) 'mn 'mx)
                (vla-getboundingbox (vlax-ename->vla-object (cddr x)) 'mn 'mx)
                (setq llpt (vlax-safearray->list mn)
                      urpt (vlax-safearray->list mx)
                      len  (distance llpt (list (car urpt) (cadr llpt)))
                )    
(cond 
((=  blkname "letterhead A2 V")(setq sc "Fit" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=1" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=2" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=3" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=4" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=5" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 H")(setq sc "Fit" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "Fit" psize "ISO expand A3 (297.00 x 420.00 MM)" ll "-3,-3" ur "280.4,403.5" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=1" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=2" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=3" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=4" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=5" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
(while (setq ent (entsel "\nselect insert. >>"))
    (setq en ( car ent))
    (if (wcmatch (cdr (assoc 0 (entget en))) "letterhead A2 V,letterhead A2 H") 
         (progn 
    (setq obj (vlax-ename->vla-object en))
 (initget "ISO full bleed A2 (594.00 x 420.00 MM) ISO expand A3 (297.00 x 420.00 MM)" ))
    (setq resp (getkword 
        "\nChoose scale [Fit/1=1/1=2/1=3/1=4/1=5] <A>: ")
        "\nChoose papersize [ISO full bleed A2 (594.00 x 420.00 MM)/ISO expand A3 (297.00 x 420.00 MM)] <A>: ")
        "\nChoose orrientation [Landscape/Portrait] <A>: ")

(command "-plot" "Y" ""  "DWG TO PDF.PC3"
psize "m" Orientation  "N"  "W"  ll ur sc "C" "y" "monochrome.ctb" "Y" "n" "n" "n" pdfName "N" "y")
(if (/= (car x) "Model")
                    (command "No" "No" file "no" "Yes") ; pspace
                    (command file "no" "Yes") ; model
                )
            )
        )
    )
    (princ)
)))

On 3/5/2023 at 8:22 AM, BIGAL said:

If you break down the cond

 

((= blkname "TITLE_BLOCK_A0_V4" ) name of tilte block

(setq sc "1=1" sets plot scale

psize "ISO full bleed A1 (841.00 x 1189.00 MM)" sheet size

ll "-6,-6" lower left corner

ur "1175,837" upper right corner

orien "Landscape" oreintation is landscape

))

 

You need to set all the correct plot parameters.

 

This is used with

 

(COMMAND "-PLOT"  "Y"  "" "DWG To PDF"   psize "m" Orien  "N"  "W"  ll ur sc "C" "y" "XXX.ctb" "Y" "n" "n" "n" pdfName "N" "y")

 

So edit code above to correct sizes and post.

 

Posted

did you end the 

(cond

... closing bracket.

  • Like 1
Posted (edited)

Also use the <> option for your code.

 

image.png.ea890d67a6dae5b637c3f85cd156d511.png

Edited by BIGAL
Posted

I did but it's not because of this, still the same problem persists.

16 hours ago, Steven P said:

did you end the 

(cond

... closing bracket.

 

Posted

Very quickly so I might have made a mistake, I've been through the code and added for example "End If" comments where the closing brackets are to make things clearer for me, also a couple of brackets on new lines just to make things clearer too.  Might be a couple of things in this, the end cond bracket is quite a way off where it should be, and there is an if statement with 3 options - I think you want to look at (setq resp (getkword... ) again?

 

 

(defun c:plot_pdf (/ en ent sc obj bas dwg file hnd i len llpt lst mn mx ss tab urpt)
  (if (setq ss (ssget '((0 . "INSERT"))))
    (progn
      (repeat (setq i (sslength ss))
        (setq hnd (ssname ss (setq i (1- i)))
              tab (cdr (assoc 410 (entget hnd)))
              bas (cdr (assoc 10 (entget hnd))) ; get insert base point
              lst (cons (cons tab (cons bas hnd)) lst) ; include insert base point
        ) ; end setq
      ) ; end repeat
;      (setq lst (vl-sort lst '(lambda (x y) (> (car x) (car y)))))
; sort by blocks insert base point x ascending = from left right
      (setq lst (vl-sort lst '(lambda (x y) (> (car (cadr y))  (car (cadr x))))))
; sort by blocks insert base point y descending = from top down
      (setq lst (vl-sort lst '(lambda (x y) (< (cadr (cadr y)) (cadr (cadr x))))))
      (setq i 0)
      (foreach x lst
        (setq file (strcat (getvar 'DWGPREFIX)
                           (substr (setq dwg (getvar 'DWGNAME)) 1 (- (strlen dwg) 4))
                           "-"
                           (itoa (setq i (1+ i)))
                           ".pdf"
                    )
        ) ; end setq
        (if (findfile file)
          (vl-file-delete file)
        ) ; end if
;        (vla-getboundingbox (vlax-ename->vla-object (cdr x)) 'mn 'mx)
        (vla-getboundingbox (vlax-ename->vla-object (cddr x)) 'mn 'mx)
        (setq llpt (vlax-safearray->list mn)
              urpt (vlax-safearray->list mx)
              len  (distance llpt (list (car urpt) (cadr llpt)))
        ) ; end setq
        (cond 
((=  blkname "letterhead A2 V")(setq sc "Fit" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=1" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=2" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=3" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=4" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 V")(setq sc "1=5" psize "ISO full bleed A2 (594.00 x 420.00 MM)" ll "-6,-6" ur "590,416" orien "Landscape"))
((=  blkname "letterhead A2 H")(setq sc "Fit" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "Fit" psize "ISO expand A3 (297.00 x 420.00 MM)" ll "-3,-3" ur "280.4,403.5" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=1" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=2" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=3" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=4" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))
((=  blkname "letterhead A2 H")(setq sc "1=5" psize "ISO full bleed A2 (420.00 x 594.00 MM)" ll "-6,-6" ur "416,591" orien "Portrait"))

;;No End Cond bracket here? 

          (while (setq ent (entsel "\nselect insert. >>"))
            (setq en ( car ent))
            (if (wcmatch (cdr (assoc 0 (entget en))) "letterhead A2 V,letterhead A2 H") 
              (progn 
                (setq obj (vlax-ename->vla-object en))
                (initget "ISO full bleed A2 (594.00 x 420.00 MM) ISO expand A3 (297.00 x 420.00 MM)" )
              ) ; end progn
              (setq resp (getkword 
                           "\nChoose scale [Fit/1=1/1=2/1=3/1=4/1=5] <A>: "
                         ) ; end getkword
                    "\nChoose papersize [ISO full bleed A2 (594.00 x 420.00 MM)/ISO expand A3 (297.00 x 420.00 MM)] <A>: "
              ) ; end setq
              "\nChoose orrientation [Landscape/Portrait] <A>: "
            ) ; end if... 3 if options!

            (command "-plot" "Y" ""  "DWG TO PDF.PC3"
               psize "m" Orientation  "N"  "W"  ll ur sc "C" "y" "monochrome.ctb" "Y" "n" "n" "n" pdfName "N" "y")
            (if (/= (car x) "Model")
              (command "No" "No" file "no" "Yes") ; pspace
              (command file "no" "Yes") ; model
            ) ; end if
          ) ; end while
       ) ; end cond
    ) ; end foeach
    (princ)
  ) ; end progn
 ) ; end if
) ; end defun

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...