Hello everybody,
I got a design with some parts and assemblies and I realized I could use a couple of global variables to calculate something that will later be used in a custom property, but I don't know how to add variables in batches. For now I solved the problem for the new files by creating a template which already includes the variables and properties, but the other parts that were already there and did not have any variables... I'm looking for a way to do it all at once, maybe with the task scheduler or a macro?
Thanks for your help!
Daniel Restrepo
Yes it is possible. You can also add the custom properties in batch runs. But... if the files are in a PDM system, then it might be more difficult depending on which system you are running.
Here is a link to a blog at cadsharp.com. It instruct how to run macros with Task schedule.
http://www.cadsharp.com/blog/run-solidworks-macros-using-task-scheduler/
and here is a link to the equation manager API interface (click members to see properties and methods)
http://help.solidworks.com/2014/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IEquationMgr.html
And here is a link to the Add3 method in equation manager API, which is used to add global variables and equations.
http://help.solidworks.com/2014/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IEquationMgr~Add3.html
Just let us know if you need further help.