SW API HELP(Tolerance)
SW API HELP(Tolerance)
(OP)
Hello All,
I have been working on a SW design program for quite some time now. I have almost goten the entire program complete... however I have two questions I am hoping that some of you with a little bit more coding experince might be able to help me with.
My first problem is I cannot figure out the VB code to run a Solidworks macro. I am trying to run the following macro at the end of my code right after it saves the drawing. "Macro78 - JRC.swp" which is located at "C:\Documents and Settings\dsheets\Desktop"
My second problem is pushing a bilateral tolerance to the model. I cannot seem to find the nomenclautre to set a bilateral tolerance for a specific parameter. Such as D1@sketch1.
I have been working on a SW design program for quite some time now. I have almost goten the entire program complete... however I have two questions I am hoping that some of you with a little bit more coding experince might be able to help me with.
My first problem is I cannot figure out the VB code to run a Solidworks macro. I am trying to run the following macro at the end of my code right after it saves the drawing. "Macro78 - JRC.swp" which is located at "C:\Documents and Settings\dsheets\Desktop"
My second problem is pushing a bilateral tolerance to the model. I cannot seem to find the nomenclautre to set a bilateral tolerance for a specific parameter. Such as D1@sketch1.






RE: SW API HELP(Tolerance)
On Error Resume Next
Set swApp = GetObject(, "SldWorks.Application")
swApp.RunMacro "C:\Documents and Settings\dsheets\Desktop\Macro78 - JRC.swp", "Macro1", "main"
Open notepad and copy that into it. Save it and change the extension to .vbs and run it. "Macro1" is the name of the module, and "main" is the name of the sub, so make sure those match what you have. This also requires SolidWorks to be open. You can add code that checks if it's open, and opens it if it is not already.
Would this even be a path you'd consider?