How to Start FEM Simulation Without Using SendKeys in Inventor API

How to Start FEM Simulation Without Using SendKeys in Inventor API

gerd
Explorer Explorer
292 Views
0 Replies
Message 1 of 1

How to Start FEM Simulation Without Using SendKeys in Inventor API

gerd
Explorer
Explorer

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!



0 Likes
293 Views
0 Replies
Replies (0)