Write Userform values in a part family

Hi all

I'm going to create a macro with several Userforms allowing you to choose an article to open or to create a new one. I would like to write the values entered in the UserForms in the excel cells of my room family. I would have liked to know how to proceed because I seem to have people already talking about it such as:A.Leblanc.

Thank you for your help

2 Likes

Hello 

Download the macro I made for a.leblanc, If my memory serves me correctly, I commented on the code.

To retrieve the data from a form, you have to go through the controls you add to it.

If you place a textbox, use thenameofmytextbox.text or value, I don't have the pc in front of my eyes:)

 

6 Likes

For the time being, I'm curious to know how to insert it into the family of parts:)

2 Likes

Hello

For information, here is the post:

http://www.lynkoa.com/forum/import-export-formats-neutres/lier-famille-de-pi%C3%A8ce-et-propri%C3%A9t%C3%A9s-personnalis%C3%A9es-de-mep

Thanks again to industrialcadservices.

5 Likes

Good evening

I took a moment to do this macro.

The code is commented and quite simple.

Usage: 

Open the part in Solidworks contained in the zip folder

Launch the macro

Choose what you want to do

The first part of the macro allows you to choose an existing configuration by selecting it in a combobox and displaying it in SW

The second part allows you to create a configuration by filling in fields in the form. By clicking on "Create my new configuration", the code will open the family of parts and write the values directly to it. You will see in passing the use of CDbl() which allows you to convert a String to a Double.

To see the code, right-click on the UserForm1 in the project window and select "Code"

I hope this code inspires you:)


macro_interop_famille_de_pieces_et_excel.zip
3 Likes

 Hello industrialcadservices !

You are really an expert in macro because you have just given me some very good ideas and your code is very clear ! +1000 for this one.

Thanks again, I'll keep you posted for my final macro:)

1 Like