Macro creation of a parallelepiped according to dimensions present in an excel table

Hello

I would like to know if someone could guide me. I don't know anything about code and I have a hundred simplified panel representations to model.

I have an excel file with the names of each panel as well as its dimensions Height x Width x Depth.

I would like to know if it was possible to ask solidworks to retrieve the name and dimensions from the excel file and save the part and then continue line by line to avoid having to do it manually.

Hope that my message is understandable. ^^

 

 

1 Like

Do you have to create a family of rooms

so you create a ref  one that won't be useful to you

then you copy  all the parameters for the other parts

See this tutorial

 http://www.lynkoa.com/tutos/3d/famille-de-pieces-solidworks

@+

4 Likes

Hello

Quick question:

Would you like to have a room for each panel? in this case it's possible to do it with a macro, but I'm not good enough in SW API to help you.

Or do you want a single room, with as many configurations as you have panels? In this case, you have the families of parts that exist in SW

Here is a tutorial:http://www.lynkoa.com/tutos/2d/famille-de-pieces

You create your part once by giving names to your dimensions (h, w, p), then you glue your excel table. SW will make you as many configurations as you have lines. You can change or add them at any time.

A+

Edit: by the time I answer, gt22 has been there :-)

3 Likes

Hello

Thank you for your answers. I would like to have one share per panel.

stupid question and what are you going to do with a library

it's going to take up a lot of space

Do you think this is rational?

@+

1 Like

Each parallelepiped will correspond to the size of an Electrical panel, I then have to position them in the different rooms for which they are intended and thus check the layout in each room as well as the possible clashes with other elements present. 

well you make your room family and open each element that you name via 

the ownership of

See this tutorial

http://www.lynkoa.com/tutos/3d/la-concatenation-de-proprietes-dans-solidworks-aout-2014

You will have all your pieces that you can put in the right place

@+

See this link

http://www.lynkoa.com/forum/solidworks/lien-fichier-excell-et-piece-sw

@+

You also have the possibility to create Publisher configuration via an Excel table

See this tutorial

https://www.youtube.com/watch?v=Rp2MRiY8T-M

@+

 

Hello

For my part, I think the easiest way is to make a file with confs and then split them into parts files (utilities already exist to make this separation into n files). No need to start a specific development and in case of adding a new panel just keep the original file, add a conf and then restart the split.

3 Likes

And would you know the names of these utilities?

Here is an excel file driving SW (SW2016 - Change VBA references in case of a different version) that creates and saves parts according to the information given in the table (Name, height, width, depth)

You need to fill in the excel file the location of your SW part model and the location where you want to save the parts.

 


creation_panel.xlsm
2 Likes

I don't have the name in mind anymore but it was available at axemble so probably on the current site. Probably explodeconfiguration or something like that.

1 Like

See here among others

http://www.cadware-utilities.fr/index.php/ressources?cat=telechargements

http://www.cadware-utilities.fr/index.php/ressources/default/ShowInLine?file=telechargements/03-Macros_SolidWorks/Reconstruire_Configuration.swp&categorie=Macros_SolidWorks&cat=telechargements&titre=Reconstruire%20les%20configurations

@+

Hello

I used all your advice and I didn't really do what I wanted but it will do, so I created a family of rooms with the right panel name for each configuration. And then I found a code to save the part under the name of the active configuration. I'm posting the links below just in case ^^.

http://www.forum-cao-3d.fr/post118820.html#p118820

In any  case, a big thank you for your answers and your help at the same time. ^^

1 Like

If the problem is solved, choose the answer that gave you the + to close the question

thank you @+