Any Macro to Covert Drawing into PDF..?

Any Macro to Covert Drawing into PDF..?

rushabhthakkar_910
Advisor Advisor
772 Views
13 Replies
Message 1 of 14

Any Macro to Covert Drawing into PDF..?

rushabhthakkar_910
Advisor
Advisor

Hello Everyone,

 

I use AutoCAD Daily. And I have to convert AutoCAD Drawing sheets into PDF. 

 

So I usually press Ctrl+p, select Window, Paper Size like A1, A2, A3, A4 (99% these are the sizes I use), than preview it and than save it. 

 

So has anyone created any Macro or an easy Method so that I can only drag a file and it automatically creates the PDF with the Drawing size. And saves it...? 

Thanks and Regards,


Rushabh Thakkar.


Please use the Accept Solution button to mark any posts that provide the answer or solution. 


Likes are always welcome.


LinkedIn | Instagram | Facebook.      


                        


 


 

0 Likes
773 Views
13 Replies
Replies (13)
Message 2 of 14

imadHabash
Mentor
Mentor

Hi,

I suggest to try AUTOMATICPUB (System Variable) .. >> Click << 

 

Imad Habash

EESignature

Message 3 of 14

rushabhthakkar_910
Advisor
Advisor

Tried using it. But how do I change the Window..? 

 

The drawing is coming very small. 

 

And I have Standard Templates ready for A1, A2, A3, and A4. I don't use any other size of drawing.

 

So how do I fit the drawing in Landscape and the size it should decide on its own. 

 

Depending on which template I have used, it should select the Plotted PDF's size to the same. And not that I have drawn in A2 and it has created PDF in A1. 

Thanks and Regards,


Rushabh Thakkar.


Please use the Accept Solution button to mark any posts that provide the answer or solution. 


Likes are always welcome.


LinkedIn | Instagram | Facebook.      


                        


 


 

0 Likes
Message 4 of 14

pendean
Community Legend
Community Legend
]Things to explore in HELP to get you started (Automation comes from pre-planning in AutoCAD) in between tags-adding to your signature 😉

1) Expand your TEMPLATE files with "everything" you need and in those templates get into exploring the creation of Named Pagesetups https://www.google.com/search?q=autocad+named+pagesetups+tips

2) start using PSETUPIN command https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2021/ENU/AutoC...

HTH
0 Likes
Message 5 of 14

maratovich
Advisor
Advisor

 

No problem, use this - Revers 

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 6 of 14

rushabhthakkar_910
Advisor
Advisor

Is this Payed..? @maratovich 

Thanks and Regards,


Rushabh Thakkar.


Please use the Accept Solution button to mark any posts that provide the answer or solution. 


Likes are always welcome.


LinkedIn | Instagram | Facebook.      


                        


 


 

0 Likes
Message 7 of 14

rushabhthakkar_910
Advisor
Advisor

@pendean, Created Named Page Setups. But they did not show up in other Drawings. They were only visible in the Drawing they were created in. 

 

Also will they work if the Drawing has been plotted by selecting a Window and other Drawings might not be placed in the exact same position...?

Thanks and Regards,


Rushabh Thakkar.


Please use the Accept Solution button to mark any posts that provide the answer or solution. 


Likes are always welcome.


LinkedIn | Instagram | Facebook.      


                        


 


 

0 Likes
Message 8 of 14

rushabhthakkar_910
Advisor
Advisor

Also there is Difference in Line Type, their Colour, Line weight, etc.

 

Whereas the Plot Style I have chosen does not behave this way. 

rushabhthakkar_910_0-1636257147783.png

 

You can see from the above Image, Everything looks good to me. Yet it is not Plotting as it should.

 

Thanks and Regards,


Rushabh Thakkar.


Please use the Accept Solution button to mark any posts that provide the answer or solution. 


Likes are always welcome.


LinkedIn | Instagram | Facebook.      


                        


 


 

0 Likes
Message 9 of 14

maratovich
Advisor
Advisor

@rushabhthakkar_910  написал (-а):

Is this Payed..? @maratovich 


Yes, like any work.

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
Message 10 of 14

pendean
Community Legend
Community Legend
@rushabhthakkar_910 If I may ask, as you new to AutoCAD? Content in some files do not automagically appear in all other files, that's not how this program works.

>>>...Created Named Page Setups. But they did not show up in other Drawings. They were only visible in the Drawing they were created in. ...<<<
You missed the second part of my original reply: you now use PSETUPIN to import these the from your templates.

Now you also need guidance in how to create, assign and use more than one CTB, yes? Or are you asking about ho to assign colors to layers that match your CTB settings?
Or did you just forget to select the box PLOT WITH PLOT STYLES on the PLOT command pop-up? Explain please.

0 Likes
Message 11 of 14

rushabhthakkar_910
Advisor
Advisor

No @pendean, I am not new to AutoCAD. I have been using it for 3-4 Years. 

 

But my use was very minimalistic to Projects and Student type of use. 

 

And AutoCAD has a Lot of Commands which we cannot learn in a Blink of Eye. We need to use them frequently to get used to them. 

 

And what I had been using since the beginning was not at all related to Plotting, Publishing, CTB, etc. 

 

As I would just make a normal PDF or take Screenshot of my work. And that worked for me. 

 

But now I am in Day to Day touch with CTB, Plotting, Publishing and other Commands. 

 

Also I have around 10-15 Plotting Styles that someone else has created which i have to use. 

 

And I have to make 20-40 PDF's too in an Hour now. So I was thinking of something that can help me save time. 

 

And after creating PDF, to Plot them too is also in the Que. 

 

 

 

 

Thanks and Regards,


Rushabh Thakkar.


Please use the Accept Solution button to mark any posts that provide the answer or solution. 


Likes are always welcome.


LinkedIn | Instagram | Facebook.      


                        


 


 

0 Likes
Message 12 of 14

rushabhthakkar_910
Advisor
Advisor

And if you can help me with Pagesetupin command and CTB thing you told, it would be great. 

 

The image I shared above is the settings we use for normal Plotting. Which I have used here. Yet the result is not the same. 

Thanks and Regards,


Rushabh Thakkar.


Please use the Accept Solution button to mark any posts that provide the answer or solution. 


Likes are always welcome.


LinkedIn | Instagram | Facebook.      


                        


 


 

0 Likes
Message 13 of 14

hak_vz
Advisor
Advisor

AS @pendean  has pointed out in his reply (post #4) secret is in using named page setups. Here is a simple autolisp function used to plot all named page setups in case when one or more drawing sheets are defined in model space.

It creates PDF files in same directory as DWG drawing. Name of PDF is defined by the name of particular setup. It will print all named page setups and only omit one named *Model*.

Since named page setup defines all printing properties, creation of pdf file is instant.

For single page printing you use named page setup. For instantly printing all named page setups, either one or 50 of them you use visual lisp script. Similar script can be created for printing layouts, where name of pdf file would be defined by layout name, attribute in title block or whatever.

This code was created as a on request of user who creates multiple sheets in model space. Although preferable option would be using layouts.

 

(defun c:batch_plot_pdf_modelspace ( / page_setups)
(setq page_setups (vla-get-plotconfigurations (vla-get-ActiveDocument (vlax-get-acad-object))))
(vlax-for item page_setups
	(if (not(wcmatch (vla-get-name item) "*Model*"))
		(vl-cmdf
			"_.-plot" 
			"No"
			"Model"
			(vla-get-Name item)
			(vla-get-ConfigName item)
			(strcat (getvar 'dwgprefix) (vla-get-Name item) ".pdf")
			"No"
			"Yes"
		)
	)
)
(princ)
)

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 14 of 14

jrreid
Advocate
Advocate

I have several different ways of plotting. Sheet Set is number one on the list.

But I use old school drop downs (image 1) and program for each printer/plotter/color/bw/etc.

If I need special CTBs I create a new drop down and call it out. Very easy and reliable.

How to program is below the image 1.

But I also set up buttons for our every day plotting needs. I plot one time with my settings and use one of the 3 below (last images). 1. Set my sheet up and not print. 2. Set sheet up, don't save settings then print. 3. Set sheet up, Print and save settings for the next time.

 

jrreid_0-1636478694251.png

Program codes:

jrreid_1-1636478743854.png

 

This is how my side panel looks with buttons programed through CUI.

jrreid_2-1636479140840.png

 

I know this is a lot but you have many options with AutoCAD.

 

Hope this helps.

 

JRR.