Macro recording problem

Hello

 

I made a macro in solidworks that mainly allows me to automatically save the PDF of a drawing from an open and active part in solidworks.

 

My macro works as long as the part opened in solidworks is stored either locally on the PC or via EPDM. On the other hand, if the part opened in solidworks is stored on my company's network (Fileserv) the macro does not work.

 

Having noticed this malfunction, I retrieved the registration address of my PDF file using the MsgBox command. And I noticed that when I'm working on a part that's stored on the network, the address starts with " \\Fileserv\..."  ". Whereas, when the macro is working correctly, the address starts with the storage disk reference " X:\....  ".

It would therefore seem that the problem comes from the " \\ ".

 

So I did some  research on this problem. And it seems that the Dos FTP command can allow me to correct my macro.
However, from what I understand, this command requires you to fill in login and mdp. I preferred to avoid having to fill in this information because I set up the macro to make saving in PDF easier and faster. However, such a request, in my opinion, would cause the  gain brought by the macro to be lost.

 

Knowing that the macro is being executed from an already identified session on the corporate network, isn't there another way to fix the problem in a way that is transparent to the macro executor?

 

Beginner in the creation of code in VBA and computer science not being my richest and most effective field of expertise, I am asking for your help in order to advise me and try to correct my problem.

 

Thank you.

 

Attached is the code of my macro.


record_pdf_auto.txt
1 Like

Hi @ Flo64bab

 

question:

 

why don't you output the PDFs from the server

in theory that's where it should be no as well as all your parts and assemblies that's the purpose of the PDM

 

in practice and in theory we get out of the PDF plans once the parts and assembly are finished

 

@+ ;-)

 

Another question, why create a macro to do this if you have an EPDM?

 

It's a basic module! You can make the generation of PDFs or other formats done with a simple right-click on a file or even integrate it as an action when changing status!

2 Likes

See this link 

 

auto PDF creation with PDM company

https://www.youtube.com/watch?v=ORcNK2-61XI

 

@+ ;-)

1 Like

Same as the clergy above. With EPDM it is much easier to implement, which more than the task can be executed on another workstation than the one where the task was initiated...

A server for example, which can be extremely useful if you have many drawings to convert...

Good evening

I did exactly the same macro at home and I don't think it's a problem when the file is on the server!

But we use network drives instead, so I'll test tomorrow if I have time. What is the mistake?

 

Two small remarks about your macro:

Why launch the macro from the room and not the shot?

Why do you do 2 Msgboxes in a row and not a vbnewline for the confirmation of the extraction and the pursuit? (Knowing that these are simple Msgboxes without vbokcancel)

 

And I agree with the remark about EPDM, it does it basicly, we have PDM Workgroup that doesn't.

1 Like