Hello, I'm designing multiple elements for a vehicle. I need to evaluate multiple dynamic results of multiple possible designs. All the design is parametric so it modifies quickly but I can't find a way to run the dynamic simulation multiple times automatically and get the results from the output grapher for each simulation.
I am trying to do it via API but can't find the class of the dynamic simulation environment in the Object Model Chart to program it via .NET.
Any ideas would be appreciated
Thanks
Solved! Go to Solution.
Solved by henderh. Go to Solution.
Hi jd.gomez242,
SimulationManager is under ComponentDefinition.
Thanks to Bob van Der Donk, here is a sample VBA that can get you started to run a simulation:
Sub playanimation()
Dim odoc As AssemblyDocument
Set odoc = ThisApplication.ActiveDocument
Dim dsman As SimulationManager
Set dsman = odoc.ComponentDefinition.SimulationManager
Dim dssim As DynamicSimulation
Set dssim = dsman.DynamicSimulations.Item(1)
‘Run the simulation from construction mode without activating Simulation Player!
If Not (dssim.IsInSimulationMode) Then
dssim.ComputeSimulation
End Sub
Hope this helps! -Hugh
Thanks for the quick response. But I can't find the SimulationManager type.
Dim dsman As SimulationManager
reports: Compile error: User-defined type not defined
Where can I import it from? I'm using Inventor 2012, don't know if there I'm missing a library or something.
Thanks
Juan Diego Gómez
So there is no DS API in R2012... but is there any other way to automatize the Dynamic Simulation?
Juan Diego Gómez
Hi Juan Diego,
Well if there is no API there is no other way to automatize it, you need to upgrade version, sorry for the bad news.
Regards,
Philippe.
Hi!
I'd like to know if user can delete/reset DS results using Visual Basic routines in Inventor. I found some info in this forum and I tried the following code, as explained in some previous posts:
Sub playanimation() Dim odoc As AssemblyDocument Set odoc = ThisApplication.ActiveDocument Dim dsman As SimulationManager Set dsman = odoc.ComponentDefinition.SimulationManager Dim dssim As DynamicSimulation Set dssim = dsman.DynamicSimulations.Item(1) If Not (dssim.IsInSimulationMode) Then dssim.ComputeSimulation Else MsgBox ("First delete the old simulation") End If End Sub
Instead 'MsgBox' command at line #12, I need an instruction like 'dssim.DeleteSimulationResults', that is, an equivalent VBA command for the button in the attached picture.
My final porpouse is to write a VBA code to execute the dynamic simulation of an assembly several times changing some parameters every simulation, to perform data analysis on output results in 3D contacts between parts.
I want to determine the math model of 3D contact with both empirical and rational way (least squares between simulation results and ODE) for better understand the 3D contact joint parameters (stiffness and damping).
Thanks.
Matteo
Can't find what you're looking for? Ask the community or share your knowledge.