Advanced in Publish

Advanced in Publish

S_S_SS
Advocate Advocate
998 Views
13 Replies
Message 1 of 14

Advanced in Publish

S_S_SS
Advocate
Advocate

Hello every one 
i need a lisp to make publish with "acad" page setup but also make the yellow color to black 

to export all layouts of the current drawing to pdf  in  "A0" Size 
and make the pdf in the same location of the drawing and have the same name of the drawing but add "acad" word in the suffix of this name 

and thanks in advance 

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

TomBeauford
Advisor
Advisor

A color based Plot Style can make yellow objects plot black.

You can print any size PDF "A0" Size. 

64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
Message 3 of 14

S_S_SS
Advocate
Advocate
Thanks sir
I know that
But I need a lisp that make that too put the pdf in the same location if the drawing and have the same name with "acad" word
0 Likes
Message 4 of 14

maratovich
Advisor
Advisor

 

No problems. Use this -Revers 
Or give an example to give you pictures to help.

 

 

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

S_S_SS
Advocate
Advocate

001.JPG

002.JPG

 

mostafahisham62_1-1646548288391.png

 

 

  First i need to add a printer setup name "acad2" as shown in the first image 
this acad2 change the color yellow  to black on the pdf as shown in the second image 
and i need the exported pdf in the same location with the dwg file and have the same name but add "acad" in the last of the name of the pdf file as shown in the third image 

and thanks in advance about that 

 

0 Likes
Message 6 of 14

hak_vz
Advisor
Advisor

Create named page setups and print them to pdf using this lisp

 

 

(defun c:batch_plot_pdf( /)
	(setvar 'cmdecho 0)
	(vlax-for item (vla-get-plotconfigurations (vla-get-ActiveDocument (vlax-get-acad-object)))
		(cond 
			((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 (strcat "\nPrinting:  " (strcat (getvar 'dwgprefix) (vla-get-Name item) ".pdf")))
			)
		)
	)
	(setvar 'cmdecho 1)
	(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 7 of 14

S_S_SS
Advocate
Advocate

i have mage the setup page called "12"
and then there is an error about it 

00010.JPG

this message appeared and gives error 

 "Cannot use paper space setup in model space."

 

0 Likes
Message 8 of 14

hak_vz
Advisor
Advisor

To plot create your setups in model space. This code is for it.

If you need to plot from layouts modify -plot command sequence and change "Model" according to what is needed.

Follow command -plot options.

PDF is saved to same directory as dwg file and its name equals plot setup name.  Change last line accordingly. I hope you know some lisp so you can modify if yourself.

 

(vl-cmdf
	"_.-plot" 
	"No"
	"Model"
	(vla-get-Name item)
	(vla-get-ConfigName item)
	(strcat (getvar 'dwgprefix) (vla-get-Name item) ".pdf")
	"No"
	"Yes"
)

 

 

 

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 9 of 14

S_S_SS
Advocate
Advocate
thanks sir
but i need it to print all the lay outs they have different names and their name and count is variable
and i need the file pdf have the name of the dwg and with the name of the printer page setup
thanks sir for your effort

0 Likes
Message 10 of 14

maratovich
Advisor
Advisor

Run the program setup once:
1. Plot style table - select "New".
2. Create a new one - name "NEWacad.ctb"
3. When creating - "Print Style Table Editor"
4. Specify for yellow - black.
5. Set the checkbox - "Use table for new and previously created"
6. Press the "Finish" button.
7. The new style will appear in the table list.
photo 1

1.PNG
8. Restart AutoCAD. Open your files (20-112-EGY-ANOPIC-UNIT 1A01).
9. Start Revers.
10. Open the Template tab.
11. Click the "Update printers" button to get a new "NEWacad.ctb"
12. Fill in the template table.
photo 2

2.PNG
Set filename :
13. Open the Settings tab.
14. Select Publish to PDF
15. In field 30-"user text" enter "(ACAD)"
16. In the "file name" field, enter "10-30" this will be the file name and user text
17. In the field insert between - enter " " a space.
18. Specify the location to save the file - next to the file.
photo 3

3.PNG
18. Save settings.
Seal :
19. In the main window, click Revers - Find all formats
photo 4

4.PNG
20. Press the button - Publich to PDF.
Ready.

5.PNG

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

hak_vz
Advisor
Advisor

@S_S_SS wrote:
thanks sir
but i need it to print all the lay outs they have different names and their name and count is variable
and i need the file pdf have the name of the dwg and with the name of the printer page setup
thanks sir for your effort


@S_S_SS  You are regular to this forum with your requests. Did you try to learn some basics  of autolisp (visual lisp), at least what basic commands do. You have been provided general solution and you should be able to make modifications according to your own needs. Code is simple and intermediate cad user is suppose to be able to make basic code modifications. IMO learning autolisp is a must for any user who knows basics of cad and learning has to start parallel with learning drafting in cad.

 

@maratovich  Is it really necessary to have  separate application to perform batch printing? I know you want to sell your software, no mater that your price is symbolic. Try to answer OP request with simple code snippet and not just providing link to your site. 

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.
Message 12 of 14

maratovich
Advisor
Advisor

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

Try to answer OP request with simple code snippet and not just providing link to your site. 

Please check all replies before posting.
I wrote all the steps and attached pictures.
See my previous post - this is the solution.
Don't blame others. We are considering all possible solutions.

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

S_S_SS
Advocate
Advocate
thanks for that
0 Likes
Message 14 of 14

S_S_SS
Advocate
Advocate

thanks sir about that
I'm a civil engineer and I keep learning and developing my work by making it smarter and easier by less effort
I'll learn python to work with dynamo in Revit program in the future
but now I need to reduce the time to achieve my work as much as possible …
I only need these lisps to reduce the pressure of work on me
I don't want to sell any thing that I don't make it isn't my principles …
In contrast I have made some advanced dynamic blocks by myself and I shared them in linked-in for free
what I think that I need some few things needed to be made by auto lisp if someone help me about that I'll direct my effort in another thing
thanks for your old effort with me you helped me a lot and @Sea-Haven  helped me more and more to make a great thing … 
and I'll work to understand what I should make to custom my lisp that make publish ..
thank you about the basic code
and thanks @maratovich  for your effort 

0 Likes