Macro solidworks save as, browse

Hello

After taking the macro from .PL in his tutorial "Macro Save As with SW" and making the changes to my case.

http://www.lynkoa.com/tutos/3d/macro-enregistrer-sous-avec-solidworks

I want to include a "Browse" button when choosing the location of the recording.

By default we have the "parent" one and I would like to add this button so that I can go and get a different path.

If anyone has an idea?

Thank you

Hello

You have to create a form with a button.

See this tutorial: http://silkyroad.developpez.com/VBA/UserForm/

See you.

PS: Are you from Forez?

Hi remrem,

A form of will not restrict the choice of path?

I would like a "Browse" button to look for any path on a computer or a network.

Here is a tutorial to recover a path: http://access.developpez.com/faq/?page=CheminsRep#AffBoitDialog

Hello

Send me your code if you want.

I'll see what I can do.

1 Like

Here's my code, if you can help me.

PS: I still haven't had time to look at the tutorial you sent me.


enregistrer.txt

Hello

Did you read and understand Lucas' macro?

There are many elements that are specific to their operation such as managing properties, deleting the revision table, creating the file name.

What do you want for all of these points?

 

1 Like

In fact, when you launch the macro I posted, it generates a save copy under the Solidworks part and that drawing.

At the end, just before validating, the macro asks for the location of the recording (by default it indicates the location of the record that we have just copied)

This is where I would like to add a "BROWSE" button to look for another recording location.

Yes, I understood correctly. But this is the visible part of the changes.

Because the macro doesn't just do a save as, it does much more. It modifies the properties of the part, clears the revision table, etc.

Have you ever done VBA?

I did very little VBA (really little)

But for the moment I can get by pretty much, the macro generates the part and its MEP that I want by deleting the revision table for example, with a new name, yes.

We just have to improve it for the recording location.

1 Like

Hello

I found more info here: http://vb.developpez.com/faq/?page=Fichiers#select_rep

Hello,  I thank remrem for taking the initiative to share the link to the tutorial. It's very nice of you but I have another problem. Would it be impossible to perform this task without using a button ? By that I mean, if it would be possible to create the form without a button ?