Hi,
I want to make a vba code to calculate the Interferences between all parts of an Assembly.
First I modify all holes with thread. Next with de CommandManager I Launch the AssemblyAnalyzeInterferenceCmd. And finaly I modify all holes with thread back.
My question is :
How to wait until the AssemblyAnalyzeInterferenceCmd is finished to continue the code.
Sub Interferences()
Call BeforeAnalyzeInterference
ThisApplication.CommandManager.ControlDefinitions.Item("AssemblyAnalyzeInterferenceCmd").Execute
Call AfterAnalyzeInterference
End Sub
Thank's
Regards
Dom
Solved! Go to Solution.
Solved by bdeslippeoutlook_com. Go to Solution.
Search in the programming help for AnalyzeInterference in the AssemblyComponentDefinition interface.
There is a good description of how it works with sample code. I have other samples but the API help is probaly good enough.
/Johan
Thank you for your answer.
I've tried this method. It works fine. But I would like to have the same representation of the results obtained by the Inventor command.
It is the reason for which I used the command : ThisApplication.CommandManager.ControlDefinitions.Item("AssemblyAnalyzeInterferenceCmd").Execute
Regards,
Dom
What do you mean by "same representation of the results"?
With the same dialog box and red color for the interference volume.
I'm a bit late to this thread but was looking for an answer myself and came across what I think is a good solution to your problem from the help docs. If you are using the command manager to execute the command you can use execute2() instead of execute()
' Will pause the code (synchronous execute)
Me.CommandManager.ControlDefinitions.Item("DrawingOrdinateDimensionCmd").execute2(true)
' Will not pause the code (asynchronous execute)
Me.CommandManager.ControlDefinitions.Item("DrawingOrdinateDimensionCmd").execute2(False)