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: 

Symulation Results in API

3 REPLIES 3
Reply
Message 1 of 4
jd.gomez242
385 Views, 3 Replies

Symulation Results in API

Hello

 

I'm developing a program which runs several simulations and obtains the results automatically.

 

I'm using the dynamic simulation API created in Inventor 2013. For that I use the GetResultValues(ByRef values() as Double) method of the class DSResult. 

I used the method inside the VBA of inventor and worked well. But when I wrote the program in Visual Basic Express 2010, the method doesn't return anything.

 

I share an excerpt of the code:

 

---------------------------------------------------------------------------------

Dim odoc As AssemblyDocument

odoc=invApp.Documents.Open(testPath, True)

 

Dim dsman As Inventor.SimulationManager = odoc.ComponentDefinition.SimulationManager

Dim dssim As Inventor.DynamicSimulation = dsman.DynamicSimulations.Item(1)

Dim oJoints As Inventor.DSJoints = dssim.DSJoints

oJoint = oJoints.Item(1)
oJointDef = oJoint.Definition
oDegs = oJointDef.DegreesOfFreedom

 

Dim values(steps* 2 + 1) As Double

 

oDeg = oDegs(1)

oResults = oDeg.Results
oResult = oResults(9)

nombre = oResult.Name


Call oResult.GetResultValues(values)

------------------------------------------------------------------------

 

The method GetResultValues(values) should modify 'values' to a time,value vector.

It works well inside Inventor, but doesn't in the program in VB, although it runs the simulations and does everything else right.

 

Thanks for any help

 

Juan Diego Gómez

3 REPLIES 3
Message 2 of 4
henderh
in reply to: jd.gomez242

Hi Juan,

 

  I've forwarded the question onto Development with a link to this thread.

 

Best regards, -Hugh



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

Hi Juan,

 

  We can get the VB Express code to work on our end.  However, if the model / simulation is not the same one used, it may not work.  This is the only reason we can come up with why the code works in Inventor VBA but not VB Express.

 

  Attached is the code we used successfully in VB Express.

 

Best regards, -Hugh



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

Hello

 

I'm now using the code you provided.

Here are the steps I followed:

 

First I open the assembly

Then get to the Dynamic Simulation Environment

Then run the simulation.

Then check the output grapher to verify if I got something

 

Finally I run the code in vb express. 

 

But I still get nothing in the values() vector.

Any ideas why the reference vector doesn't modify?

Thanks

 

Juan Diego Gómez

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report