Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic Simulation Automatization in API

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
jd.gomez242
928 Views, 6 Replies

Dynamic Simulation Automatization in API

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

 

 

6 REPLIES 6
Message 2 of 7
henderh
in reply to: jd.gomez242

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



Hugh Henderson
QA Engineer (Fusion Simulation)
Message 3 of 7
jd.gomez242
in reply to: henderh

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

Message 4 of 7
henderh
in reply to: jd.gomez242

Ahhh...apologies Juan.  The DS API is new to R2013.



Hugh Henderson
QA Engineer (Fusion Simulation)
Message 5 of 7
jd.gomez242
in reply to: henderh

So there is no DS API in R2012... but is there any other way to automatize the Dynamic Simulation?

 

Juan Diego Gómez

Message 6 of 7

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.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 7 of 7
GiorgioCruzza
in reply to: henderh

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.

Post to forums  

Autodesk Design & Make Report