how do i automate filing a pdf of drawing with filename_revision into a specified directory?
SolidworksDrawings And Detailing
how do i automate filing a pdf of drawing with filename_revision into a specified directory?
SolidworksDrawings And Detailing
Welcome to SolidWorks forums Paul.
You can use macro to do it. Here are some post from where you can use the macro (you may have to edit them to suit the need).
https://forum.solidworks.com/message/151028#151028
https://forum.solidworks.com/message/200992#200992
https://forum.solidworks.com/message/158149#158149
https://forum.solidworks.com/message/321740#321740
https://forum.solidworks.com/message/138027#138027
You might also find this post helpful for your future reference.
Thankyou for you fast reply. Guess i'll be using this forum more often.
Running the macro first time.
Looking at using this one. https://forum.solidworks.com/message/151028#151028
first error
IMPORTANT! sheet name 'sheet1' not named according to procedure.
What is the procedure ?
Try this macro. You would need to set the path first:
Works well thankyou very much....You have been very kind.
Just one more thing, if possible, is that our placement for the pdf files is one directory below the solidworks drawing location. Solidworks drawings are filed in different locations but always the pdf is one directory down. The directory name funny enough is .\PDF.
Would like to allow yes/no to over file if there is a duplicate and to move previous lower revision if they exist to ..\trunk
Yes can be done. Just change the path to whatever you want. And In case you the path will change based on each project then please give me one path example for drawings and PDF and I'll see if that can be set in the macro itself.
Yes can be done. The macro will pop up with Yes OR NO buttons.
I'll have to check this.
In bold is the common portions of the file locations.
user name in the directory stucture will change depending on who is loged on.
Working directory 1.1 (the open SW drawing location)
Place for lates pdf file revisiond 2.1.
place for old revisions of pdf files 3.1.
FYI. We are using SubVersion for version control to a central database.
Testing some methods/codes on it. Looks like all of these can be done
Not able to move old PDFs with my macro. Can you do that manually and my macro will do the others.
maybe pause the macro at this point to force the user to do this (maybe just a note on the screen that says to complete this task before proceeding.. move old version and to do subversion add for both.
That can be done.
I do appriciate what you are doing.
Have you had any luck with the macro ?
Just making final codes for setting the path and everything else is set up. Should be able to upload the macro in a day or two.
how is it proceeding?
Hi Paul, got side tracked with some medical emergency. Will finish up the macro soon.
Sorry for a long delay, here is the macro. Give it a shot and let me know how it worked.
Did you changed anything in the macro??? If yes then please revert that back i.e. don't change anything in the macro and try again.
Paul did you had any luck with the macro yet??
Sorry Paul there was a typo in the code. Kindly use following line and remove the old ones (basically remove the back slash after PDF)
Not sure why but same macro works fine for me.
Actual location C:\Users\paulb\Documents\My Work Files\NTMS MECHANICAL.
The macro is working fine for me.
Can you please edit the macro as shown below and check:
<p>User = Environ("USERPROFILE")</p><p>User = User & FilePath</p><p>Debug.Print User </p><p></p><p>sFilePath = Left(swModel.GetPathName, InStrRev(swModel.GetPathName, "\"))</p><p>sFilePath = Mid(sFilePath, (Len(User) + 1))</p><p>Debug.Print sFilePath</p><p> </p><p>FileName = Mid(swModel.GetPathName, InStrRev(swModel.GetPathName, "\") + 1)</p><p>FileName = Left(FileName, InStrRev(FileName, ".") - 1)</p><p></p><p></p><p>Value = swModel.CustomInfo2("", "Revision")</p><p>If Value = "" Then</p><p>MsgBox "Please add Revision property OR value and try agian."</p><p>End</p><p>End If</p><p></p><p>Debug.Print User & sFilePath & "PDF"</p>And let me know what you see in the immediate window. Also make sure you're logged in as Paulb and not Paulb.NTMS.
Here is another macro with slight changes. Can you try this one.
Also did you tried the one macro with changes I posted above? If yes, then what was the result.