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

API - Deflection query to txt file

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
686 Views, 3 Replies

API - Deflection query to txt file

Hi All!

I've learned recently that I can query each and every node coordinate and write them to a single text file through Moldflow's API (which seems to be quite OLD). But I would like to do the same with the deflected parts nodes. I have found the WarpQueryNode command but can not use it.

Can anybody show me the how-to for it? 🙂

My script looks like this:

PlotManager.WarpQueryBegin 6250, Nothing
Set DVec = Synergy.CreateDoubleArray()
PlotManager.WarpQueryNode 96, 0, DVec
PlotManager.WarpQueryEnd

And I don't know what 6250, nor Nothing does in the first line.
And as a DoubleArray I am not able to see (MsgBox) nor save (To a file as string) DVec.


Thank You in advance,

Solymossy
3 REPLIES 3
Message 2 of 4
raalteh
in reply to: Anonymous

Hi Solymossy,

I don't know if you have found this yet (it's very useful but , but there is a pretty complete reference guide in the Help. Access the Help, then hit 'Home' on the top bar, click on "Application Programming Interface (API)', then 'API Reference' and then click on the 'Classes' tab. This has a full reference of all API calls, their variables and their meanings.

To find out what the variables ini 'WarpQueryNode' mean you access the 'Classes' tab and click 'PlotMgr' and then scroll down to the topic 'WarpQueryBegin'.You find the following below. I your variable '6250' is the small deflection warp data set (you can find this ID by looking in results.dat in "C:\Program Files\Autodesk\Moldflow Insight 2010-R2\data\dat'. This data set has only one data point per node (which why tthe IndependantValue is set to 'Nothing;. Another data set would be '6260' (non linear warpage data) which has multiple data points (ththe incremental load steps, which can be accessed by specifying which load step to access, using the Independant value.

I hope this helps


Boolean WarpQueryBegin ( long aDsID,
Object aIndpValues
)

Start queries on a specified warp dataset

Parameters:
aDsID data set id
aIndpValues independent variable values

Returns:
TRUE is successful
Example:
This example queries displacement values in the first anchor plane on node 100
Set Synergy = CreateObject("synergy.Synergy")
Set PlotMgr = Synergy.PlotManager()
Set queryValues = Synergy.CreateDoubleArray()
PlotMgr.WarpQueryBegin 6250, Nothing
PlotMgr.WarpQueryNode 100, 1, queryValues
PlotMgr.WarpQueryEnd
Hanno van Raalte,

Product Manager - Injection Molding & Moldflow products
Message 3 of 4
nordhb
in reply to: Anonymous

Hi,
the result is indexed, so the get the coordinate it can look something like this get each coordinate.
glob_coord_X = queryValues.Val(0)
glob_coord_Y = queryValues.Val(1)
glob_coord_Z = queryValues.Val(2)
glob_coord_defl_X = queryValues.Val(3)
glob_coord_defl_Y = queryValues.Val(4)
glob_coord_defl_Z = queryValues.Val(5)

which then can be written to a file:
ListFile.WriteLine EntityName & glob_coord_X & Coord_Delimiter & glob_coord_Y & Coord_Delimiter & glob_coord_Z & Coord_Delimiter & glob_coord_defl_X & Coord_Delimiter & glob_coord_defl_Y & Coord_Delimiter & glob_coord_defl_Z

ListFile in is an already opened file.
And Coord_Delimiter set to how coordinates should be separated in file.

You then can loop through nodes selected, and write to file.

Regards,
Berndt


Berndt Nordh
Message 4 of 4
Anonymous
in reply to: Anonymous

Thank You Guys for giving me a hand for this!

Right now I am a bit far away from programming in VB so the default API description in Moldflow was a bit tough for beginning with. I have read it through (almost) but could not hammer a working script from that. But thanks to Berndt, I now have a script that does almost the thing I want. If I put some workhours in it I think I would be able to get what I want.

Thanks again!

Balázs

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

Post to forums  

Autodesk Design & Make Report