AutoLISP for multiply change PLOTTER on all layouts

AutoLISP for multiply change PLOTTER on all layouts

MichalHakel_SP
Advocate Advocate
1,337 Views
10 Replies
Message 1 of 11

AutoLISP for multiply change PLOTTER on all layouts

MichalHakel_SP
Advocate
Advocate

Hello,

please could anyone create an AutoLISP for me to automatically changing the settingg of plotter in all layouts ?

 

WHAT I USE NOW:

I tried to use this :

(vl-load-com)
(defun c:CPS (/ Adoc Layts clyt)
  (setq	aDoc  (vla-get-activedocument (vlax-get-acad-object))
	Layts (vla-get-layouts aDoc)
	clyt  (vla-get-activelayout aDoc)
  )
  (foreach
	    itm
	       (vl-remove (vla-get-name clyt) (layoutlist))
    (vla-copyfrom (vla-item Layts itm) clyt)
  )
  (princ)
)

however, it has changed all settings including paper size of layouts.

 

WHAT I WOULD LIKE TO HAVE:

I would like to have AutoLISP to change only type of plotter for each layout I want to use for printing BUT paper size should be different on each layout.

 

I attached video to visually better represent my problem.

Thank you in advance.

0 Likes
Accepted solutions (1)
1,338 Views
10 Replies
Replies (10)
Message 2 of 11

Moshe-A
Mentor
Mentor

@MichalHakel_SP  hi,

 

WHAT I WOULD LIKE TO HAVE:

I would like to have AutoLISP to change only type of plotter for each layout I want to use for printing BUT paper size should be different on each layout.

 

Say you have such a lisp, still at plot time you have to 'walk' through each layout to set other settings. choosing a media 'breaks you? 😀  plus in page setup you can save (also in plot dialog) settings for next plots

 

just wondering?

 

Moshe

 

0 Likes
Message 3 of 11

MichalHakel_SP
Advocate
Advocate

Hello,

I need to print and plot about 250 layouts. (print 250 sheets on plotter Canon IPF770 and then plot 250 PDF files to save it on our cloud).

 

My idea is to use Batch Plot for this.

Firstly I have to walk through each layout and set it properly as I need. I will set my Plotter Canon IPF770 as default.

After I print is all on my plotter I will use AutoLISP which change plotter settings from "CanonIPF770" to "AutoCAD High quality PDF" and using Batch plot I will create that 250 PDF files I needed.

 

Using AutoLISP I can save time to changing plotter from "CanonIPF770" to "AutoCAD High quality PDF" instead of changing it 250 times in every layout...

0 Likes
Message 4 of 11

hmsilva
Mentor
Mentor

@MichalHakel_SP  when I need to export several layouts to pdf, I use the -export command.
I don't need to modify the page setup and the final quality is acceptable.

 

 

 

(defun c:demo (/ fname otab path)
    (setq otab (getvar 'CTAB))
    (setq path (getvar 'DWGPREFIX))
    (foreach layt (layoutlist)
	(setvar 'CTAB layt)
	(setq fname (strcat path layt))
	(command "_.-export" "_PDF" "_C" "_NO" fname)
    )
    (setvar 'CTAB otab)
    (princ)
)

 

 

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 5 of 11

Moshe-A
Mentor
Mentor

@MichalHakel_SP 

 

OK

Have you thought how would such a program will know which media size to choose?

what other setting it should set?

 

do you know what is Autodesk  ScriptPRO ?

 

Moshe

 

 

0 Likes
Message 6 of 11

paullimapa
Mentor
Mentor

might be faster to just create a single set of pdfs for both the cloud and the CanonIPF770 printer

while uploading the pdfs you should have ability to select & combine all the pdfs into a single multipage pdf & then send that to your CanonIPF770 printer

this way you don't have to again spend time using PLOT command to send another set to the CanonIPF770 printer


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 7 of 11

Sea-Haven
Mentor
Mentor

Like others if your layout is say fixed size title blocks at 1:1 etc then you can just use a lisp like Hmsilva to plot all layouts, we had A3 mono, A3 color, A1 and pdf's. Just choose  correct one and watch them come out. Even down to "who are you" used in multi story building so sent to correct printer in the 5 story building.

 

An example this lisp sets the correct plot settings so no need to reset each layout.

 

 

(COMMAND "-PLOT"  "Y"  "" "DWG To PDF"
	       "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE"  "N"   "W"  "-6,-6" "807,560" "1=2"  "C"
	       "y" "Acad.ctb" "Y"	"n" "n" "n" pdfName "N" "y"
    )

 

 Look at Plotting by Maratovich also.

 

Lastly have a check title block size for mixture of title blocks in layouts. Where I used to work we only had 1 title block used for like 95% of plotting.

 

Pretty sure PBE had a reset all layouts plot settings.

0 Likes
Message 8 of 11

MichalHakel_SP
Advocate
Advocate

Thank you guys for your opinions. I understand what you are saying to me. No AutoLISP as I wanted but anyway I got the information I needed so I am thankful. Have a nice day 🙂

0 Likes
Message 9 of 11

digiteks7
Community Visitor
Community Visitor

I appreciate the opinions you guys provided. You are explaining something to me that I understand. In any case, I got the information I needed even though AutoLISP was not available as I had hoped. Have a nice day

0 Likes
Message 10 of 11

hmsilva
Mentor
Mentor
Accepted solution

@MichalHakel_SP wrote:

Thank you guys for your opinions. I understand what you are saying to me. No AutoLISP as I wanted but anyway I got the information I needed so I am thankful. Have a nice day 🙂


@MichalHakel_SP 

to change the plotter name in all layouts, first you will have to create exactly the same papers (name, size, printable area) in both *.pc3, in this way only the ploter name (configname) will be changed in each layout.

 

(defun c:demo (/ adoc layts)
    (setq adoc	(vla-get-activedocument (vlax-get-acad-object))
	  layts	(vla-get-layouts adoc)
    )
    (vlax-for layt Layts
	(if (/= (vla-get-name layt) "Model")
	    (if	(= (vla-get-configname layt) "Canon iPF770.pc3")
		(vla-put-configname layt "AutoCAD PDF (High Quality Print).pc3")
		(vla-put-configname layt "Canon iPF770V2.pc3")
	    )
	)
    )
)

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 11 of 11

digiteks7
Community Visitor
Community Visitor

Thanks for sharing your thoughts. The message you are trying to convey to me is clear to me. However, I got the information I needed so I am grateful even though I didn't get AutoLISP as I had hoped. Enjoy your day. Curtain Hooks in dubai

digiteks7_0-1687513943251.png

 

 

 

0 Likes