Hello all,
Recently I have been attempting to put together a macro that is capable of mapping the position of a component within an assembly based on a series of input parameters. The logic of the macro is relatively simple, it steps through the three input parameters in a nested for loop and records the position of the component each time. However, as you can imagine with a triple-nested loop, the duration of the macro quickly grows with higher resolution in the steps.
Currently, I have it set up so each input parameter is a dimension driven off a global variable, and I edit the global variable with the macro. After every change to the global variables, I have to call swModel.EditRebuild3. On average, calling this function takes about a half second to complete.
Is there any alternative to rebuilding the whole model? Is it possible to update the location of a single component? I wasn't able to find anything online.
As an example, if I edit a distance dimension in the assembly, and increment it, the model updates almost instantly. This leads me to believe that Solidworks has a method of solving the assembly, without a full rebuild.
Any help is appreciated.
If any of you are curious about the application, it's a delta robot that I am trying to map the work volume of. Unfortunately, I am unable to use the established equations for the volume of a delta robot, because this robot needs to be packaged in an unconventional format. I was hoping to use solidworks to assist with this, but the wait times on creating the volume is making iteration painfully slow. I am happy to provide screenshots/code snippets if needed.
SolidworksApi macros