How to Start FEM Simulation Without Using SendKeys in Inventor API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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!