Our Capstone Project is a project to automate SolidWorks operations from: generating new randomized objects to creating variables and constraints to keep objects in a certain shape and size, and optimize the objects based off of experimental data using statistics.
Clone the repository into a given directory
git clone https://github.com/blogharu/CS80Project.gitThis projects uses:
-
Windows 10
-
Visual Studio
-
C#
-
SolidWorks 2019
-
Python3.4 and up
- NumPy
- SciPy
This project also uses references in Visual Studios to run properly:
SolidWorks:
-
SolidWorks.Interop.sldworks.dll
-
SolidWorks.Interop.swcommands.dll
-
SolidWorks.Interop.swconst.dll
-
SolidWorks.Interop.swdocumentmgr.dll
-
SolidWorks.Interop.swpublished.dll
How to:
- Right click the project in the right panel
- Hover over "add" in the right click menu - Click "reference" - A pop-up will appear asking you to browse for the listed files above - Default directory is: C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\
- Select the above files and add them
Once cloned into a directory, opened the project in Visual Studios, and having referenced all of the dependencies, one can build this project in Visual Studios using admin/root privillages, then start SolidWorks, and there will be a Pikachu icon on the right menu bar; this is the add-on. There are a variety of features such as:
- Adding and Deleting variables
- Listing variables
- Adding and Deleting constraints
- Listing constraints
- Auto generating a certain number of random objects and saving them as either STL or SLDWRKS files
- Running a dataset through the Python optimization program.
This program uses a formatted file for the datasets thats auto generated by the add-on. The Python optimization program uses this same file but with filled in data for the experimental data that is left blank upon generation.
Steps to use program:
-
Download the code from github,
-
Open the program in Visual Studios in Administrator Mode (It's crucial that it's done in administrator mode, to allow the necessary permissions)
-
Open the solution from our github.
-
Grab the following files from your SolidWorks folder found on the C Drive - default directory is: C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\:
- SolidWorks.Interop.sldworks.dll
- SolidWorks.Interop.swcommands.dll
- SolidWorks.Interop.swconst.dll
- SolidWorks.Interop.swdocumentmgr.dll
- SolidWorks.Interop.swpublished.dll
and place them in CS80project->bin-Debug
-
Build the program
- Note: Running it will cause an error as it is not an executable
-
Launch SolidWorks, click the pikachu icon and connect the python.exe
This section will cover usage and functionality of the add-on.
Below we will go over the different funct
The add-on uses SolidWorks variables; that is, variables that are created using SolidWorks macros. It loads these already created variables into the add-on such that the object is able to be manipulated through our random generation python scripts.
The add-on is able to constrain the object such that it doesn't lose shape while auto generating. Examples of common constraints are volume and length constraints.
As stated above, the add-on is able to auto generate different objects based off of the variables and constraints present in SolidWorks.
Lastly, optimization is done using a formatted CSV file with filled in experimental data from different variations of the same object. A user is able to load this CSV file into the add-on to constrain the variables and hone in on an optimal solution based on the experiments.
Listed below are the different use cases for our add-on.
The main use of this add-on is to rapidly generate different variations of an object in-order to create a variable spread of the object and optimize it through different generations using statistics. We gather data: flow rate for filters, lift for propellers, etc., on the spread of the object and then feed this data into the optimization functions
Below links to a demo video:
-
Can't find the add-on. This is because the add-on isn't showing. To fix this:
- Click the setting's (gear in top menu bar) dropdown menu
- Click the "Add-ins" option
- Under the "Other Add-ins" section click the checkbox next to "Addin"
For this project we plan on attaching different statistical methods to it. Right now only one statistical method is supported: the regression method, but there are plans to increase the capabilities of this thiis project to use different methods including AI and Machine Learning. The possibilities of attaching whatever model you want to this program are endless.