waiting after CommandManager

waiting after CommandManager

Anonymous
Not applicable
1,676 Views
5 Replies
Message 1 of 6

waiting after CommandManager

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
1,677 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

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

0 Likes
Message 3 of 6

Anonymous
Not applicable

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

0 Likes
Message 4 of 6

Anonymous
Not applicable

What do you mean by "same representation of the results"?

0 Likes
Message 5 of 6

Anonymous
Not applicable

With the same dialog box and red color for the interference volume.

0 Likes
Message 6 of 6

bdeslippe
Participant
Participant
Accepted solution

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)