

This should create a study named “Strength” in SOLIDWORKS. In excel, click the “Create a Study” button.Ensure that you have the SOLIDWORKS Window and the Excel window side by side.If you get a security warning message, simply click on “Enable Content”. Delete any Simulation studies that may exist in the model. Ensure SOLIDWORKS Simulation is checked / added in SOLIDWORKS.Note that the SOLIDWORKS 2015 release is required. The file called ‘ExcelToSim_Labs.xls’ is the excel file for the APIs. The filed named ‘EndLink.sldprt’ is the 3D CAD Model that we will use in this example.
#SOLIDWORKS API VBA PARSE DIRECTORY DOWNLOAD#
Here are the instructions you should follow: Download the files contained in the first bullet below by clicking on “SimAPIs”.

Now, we’ll go over an example to get hands on with the API.


This is the fundamental building block for everything you can control within simulation such as creating a study, controlling material choices, applying loads / fixtures / connectors on desired geometry, mesh settings, processing results etc. There are basic API codes / calls as shown above that help establish access to a simulation study. The following video illustrates how the Simulation API can be used to create very specific outputs as per the customer requirements very easily in a short time. The final output that a designer needs to create as part of the design review process looks like below. The image below shows how the end connections drive the effective beam lengths. The design specification requires an output of effective beam lengths and beam K factors, and also needs the list of end connection conditions for each structural member. The API macro takes less than 10 seconds to extract all the required data and create an excel file with XY plots.Īnother example shown in the below mast structure requires a custom output as per a standard specification used for structural members or beams. In the below video of a 2D snap fit assembly analysis, the relationship of force required to snap through versus the vertical push distance that is needed to understand the stiffness variation in the system. The same API macro works on 2D simplification problems as well. Using the Simulation API macro, this takes less than a minute to complete with further customization of data in excel and auto creation of XY plots! In the example below of a nonlinear analysis to simulate the push and snap operation of a latch mechanism, manually transferring the data of displacement and reaction force for each time step takes roughly about 20 minutes. Before I walk you through the steps for using the attached files, here are some practical applications of the API. While knowledge of any above programming languages will help my goal in this article is to provide you with a self-training excel automation file and a sample SOLIDWORKS part file. The API contains functions that can be called from Visual Basic for Applications (VBA), VB.NET, C++ 6.0, C++.NET, and C#.NET. The API provides a powerful platform for automation as well as productivity gains for any user who needs to build custom inputs or outputs to drive Simulation studies or has to work past user interface limitations. The SOLIDWORKS Simulation Application Programming Interface (API) functionality can be used to automate the creation of studies, applying loads and fixtures, material selection, meshing, running analyses and processing results.
