Inventor General

Reply
Active Member
jd.gomez242
Posts: 8
Registered: ‎03-21-2012
Message 1 of 4 (192 Views)

Symulation Results in API

192 Views, 3 Replies
04-30-2012 11:38 AM

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

Employee
henderh
Posts: 649
Registered: ‎06-07-2007
Message 2 of 4 (184 Views)

Re: Symulation Results in API

04-30-2012 12:56 PM 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
Simulation QA Engineer
DLS
Employee
henderh
Posts: 649
Registered: ‎06-07-2007
Message 3 of 4 (152 Views)

Re: Symulation Results in API

05-01-2012 02:15 PM 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
Simulation QA Engineer
DLS
Active Member
jd.gomez242
Posts: 8
Registered: ‎03-21-2012
Message 4 of 4 (147 Views)

Re: Symulation Results in API

05-01-2012 03:12 PM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube