Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save Drawing as PDF Macro and rev update

Status
Not open for further replies.

LCform

Mechanical
Jan 13, 2016
139
0
0
IT
Hi All

I was trying to write a macro that I can save my drawing after every revision update as a pdf file, adding the rev(num) to the file name . After recording, I needed to know, how to grab that revision name that I update manually, to the file name I wanna save. Actually if possible, I wanted to do this without running a macro, but each time I would update the revision number, this could be done automatically. Is it possible ?

Any solution is appreciated

Sub main()

Set swApp = _
Application.SldWorks

Set Part = swApp.ActiveDoc
Part.ClearSelection2 True
longstatus = Part.SaveAs3("Z:\CAS1259F5\1259F5-P02-REV0.PDF", 0, 0)
End Sub
 
Replies continue below

Recommended for you

If money's no object the Enterprise PDM program can be set up to do just what you want...



SW Professional 2015 SP 5.0
SW Electrical 2D/3D SP 5.0
64 bit
Intel Xeon X(R) CPU 3600 @ 2.80 GHz
8.0 GB of RAM
NVIDIA Quadro 2000
 
Is this revision come from custom property?

It is possible to develop what you are looking for but this needs to be developed as an integrated add-in which listens for property change events and exports the PDF if revision is changed. If you are developer I can give you some hints of API methods to use otherwise you might need to get this through the paid consultancy.

If exporting all drawings in a batch mode is an option for you you may take a look at this tool: which can export PDFs in a batch mode allowing custom naming.

Thanks,
Artem
 
Thank you Artem

yes I am the developer, yes the revision comes from the custom property. the table in the drawing section. and I think that at the moment the work is only to develop this part. to automatically save the drawing as pdf by changing revision. I do appreciate your points.

Regards
 
Status
Not open for further replies.
Back
Top