AnsweredAssumed Answered

Save Problems after accessing a part's Equation Manager

Question asked by Thomas Alleman on Apr 28, 2016
Latest reply on Aug 25, 2016 by Lennart Floreby

Hello,

 

I am having an issue with my parts not saving in the assembly after I run my macro.

 

I get an error that says "an unknown error occurred while accessing <...filepath>"

 

If I explicitly go into the part file, and open the equation manager and close it, it allows me to save the file again.

 

Thanks for any help on this.

 

Here is the code that I am having problems with

 

Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swAssy As SldWorks.AssemblyDoc
Dim swConf As SldWorks.Configuration
Dim RootComp As SldWorks.Component2
Dim swEquationMgr As SldWorks.EquationMgr
Dim bRet As Boolean

 

Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swEquationMgr = swModel.GetEquationMgr


swModel.GetComponentByName("MACTEST-1").GetModelDoc2.GetEquationMgr.Equation(1) = """Length""" & "=90"
swModel.ForceRebuild3 (False)

End Sub

Outcomes