Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
gerd
136 Views, 0 Replies

How to Start FEM Simulation Without Using SendKeys in Inventor API

Hello,

I am developing a console application to optimize parts using the gradient method. Currently, I am starting the FEM simulation using SendKeys, but I am looking for a more direct method to initiate the simulation. Here is the code I am using:

' Access the CommandManager object and run the simulation
Dim commandManager As CommandManager = invApp.CommandManager
Dim controlDef As ControlDefinition = commandManager.ControlDefinitions.Item(FeaSimulateCmdName)
Dim hWnd As IntPtr = invApp.MainFrameHWND
SetForegroundWindow(hWnd)
controlDef.Execute()
SendKeys.SendWait("{ENTER}")
System.Threading.Thread.Sleep(berechnungsdauer) ' Wait for the simulation to complete


Is there a more straightforward way to start the simulation without relying on SendKeys?

Thank you for your help!