How to create a 3D Cad in solidworks using excel Macros

Hi Team, i want to know how to create a 3D CAD (boxes) using excel macro with basic coordinates in solidworks. If anyone can help us, please do let me know for further discussion on this project.

1 Answer

I'm not an API guy so I can't really help with macros, but you can do the same using Configurations and link them to an Excel sheet.

What you'll do with the boxes you want to make can be done with any other model:
1) Make a model of one of the instances
2) Rename the dimensions and/or features you'll change from one instance to another (renaming isn't a must, but it'll ease the next step)
3) Add a new Design Table (Insert > Tables > Design Table)
4) Under "Source", choose "Auto-create" and click Ok
5) From the pop-up that'll appear, select the dimensions you want to add to the design table and an Excel sheet will appear
6) Don't add the additional instances yet, but click anywhere in the SW interface to close the Excel table, then save the model
7) Go to the ConfigurationManager and expand the "Tables" folder, then right-click on the Design Table and choose "Save Table"
8) Right-click again and choose "Delete Table
9) Add a new table, but remember to choose "From file" this time Under "Source" and browse for the Excel file you just saved (make sure to check the "Link to file" option)
10) Save the model, then close it and open the Excel sheet and add as many configurations as you may want
11) Open the SW part and it'll show you a message, so choose the "Update the model with changes made in the design table" option

If you want to export each configuration as a separate file, I have a macro that can export all configurations as separate files.

PS You can make the Excel tables yourself and add them to SW directly to save some steps, but there's a syntax that should be used when creating the design tables manually:
https://help.solidworks.com/2021/english/SolidWorks/sldworks/t_Entering_Parameters_in_a_Design_Table.htm