Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

waiting after CommandManager

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
DRudaz
613 Views, 5 Replies

waiting after CommandManager

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

5 REPLIES 5
Message 2 of 6
JohanLarsson
in reply to: DRudaz

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

-------------------------------------------------------------------------
Inventor Professional 2012 SP1 (25 seats with subscription)
Windows 7 64 bit
Lenovo D20, 12 GB RAM, Intel Xeon X5687 3.6 GHz, SSD
Quadro 4000, driver 8.17.12.9573, dual monitors
SpacePilot, driver version 6.15.3 Firmware 3.12
Message 3 of 6
DRudaz
in reply to: JohanLarsson

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

Message 4 of 6
JohanLarsson
in reply to: DRudaz

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

-------------------------------------------------------------------------
Inventor Professional 2012 SP1 (25 seats with subscription)
Windows 7 64 bit
Lenovo D20, 12 GB RAM, Intel Xeon X5687 3.6 GHz, SSD
Quadro 4000, driver 8.17.12.9573, dual monitors
SpacePilot, driver version 6.15.3 Firmware 3.12
Message 5 of 6
DRudaz
in reply to: JohanLarsson

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

Message 6 of 6

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)

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report