I was wondering if there is a way to allow the User to close the Thickness menu manually and then continue with macro?
I would think this is the same as lStatus = utThicknessAnalysis.Close() but am not certain.
I am writing a little program to help analyze the part geometry using the API Thickness Analysis tools.
The RunThickAnalysis2 has an option to allow User interface (gtResultShowUI) and scan over the model for various wall thicknesses.
The problem if that when this option is enable it stays on and does not close using.
lStatus = utThicknessAnalysis.Close()
It also prevents continue unless the macro is closed and the draft Analysis window is closed manually.
Some simplified code is below.
' ******************************************************************************
' C:\DOCUME~1\KLACHA~1.DOM\LOCALS~1\Temp\swx4104\Macro1.swb - macro recorded on 09/21/09 by klachance
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myModelView As Object
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
'--------------------Thickness Analysis--------------------
Set swUtil = swApp.GetAddInObject("Utilities.UtilitiesApp")
Set swUtilThicknessAnalysis = swUtil.ThicknessAnalysis
longstatus = swUtilThicknessAnalysis.Init()
longstatus = swUtilThicknessAnalysis.RunThickAnalysis2(0.00514571202635, 0.0098, True, 1, gtResultShowUI, "C:\Documents and Settings\klachance.DOMAIN\My Documents\switch (3) Test", False, True, True)
Part.WindowRedraw
longstatus = swUtilThicknessAnalysis.Close()
End Sub