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: 

How to use macros in probe plot of Deflection, all effects: X Component

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
php5QCWQ
432 Views, 4 Replies

How to use macros in probe plot of Deflection, all effects: X Component

I'm creating a macro for the deflection results.

During the process of obtaining the final result, I am having difficulty with the following problem.

 

In general, the order of macro application for plotting deflection, all effects:X Component is as follows.
Select New Plot--> Select Probe Plot in Deflection, all effects:X Component-->The result shows a negative value as shown below.
The created macro is as follows.

probe plot.jpg

Set PlotManager = Synergy.PlotManager()
Set Plot = PlotManager.CreatePlotByDsID2(6250, 19)
Plot.SetComponent 0
Set Viewer = Synergy.Viewer()
Set PlotManager_1 = Synergy.PlotManager()
Set Plot_1 = PlotManager_1.FindPlotByName2("Deflection, all effects:Path Plot", "Deflection, all effects")
Set Viewer_1 = Synergy.Viewer()
Viewer_1.HidePlot Plot_1
Viewer.ShowPlot Plot
Set Viewer = Synergy.Viewer()
Set Plot = Viewer.ActivePlot()
Plot.SetPlotMethod 19
Plot.SetPlotNodesFromString "N1111 N1112 N1113 N1114 N1115"
Set StudyDoc = Synergy.StudyDoc()
StudyDoc.Save

 

I expected to get the same result by running the macro.
However, the generated probe plot results did not show deflection results in the X direction.
This result is a positive value as a result of Vector in Plot Properties being selected as Magnitude.
I want to get the result for Deflection, all effects:X Component using a macro.
I can't find any API code explanation for this.

So, I want to know what the API code is for selecting vector-x.
Please explain how to solve this problem.

4 REPLIES 4
Message 2 of 5
bernor_mf
in reply to: php5QCWQ

@php5QCWQ 

Hi,
First, I noticed this in for path plot.
(Maybe you experience similar for probe plot as mentioned in topic headline?)

 

Anyway, I followed your example.
Good you provided the details.

 

I recorded a macro for path plot, Deflection all effects, with vector color in X component.
And I can repeat what you see.
When recording macro, the vector color is created in X component (Vx).
When playing the macro, the vector color is created in magnitude (Vm).

 

I had a look, but right now it seems to be a limitation (or a bug?).
I miss like "SetPathVector" and "GetPathVector" to be used with Plot.
Like "Plot.SetPathVector 0"
There is SetComponent and GetComponent which Sets displayed data component and Gets displayed data component . But seems not to apply here.

 

For the moment I have no workaround or solution to this. Sorry.
Let's see if someone else in community has any suggestions.

Regards,
Berndt

( If my comments are accepted, provide "Kudos" as appreciation. If your request is answered/resolved, please click the "Accept as Solution" button. Thanks.)
Message 3 of 5
php5QCWQ
in reply to: php5QCWQ

Thank you for your reply. While looking for a solution to this problem, I referred to the information below. In the end, I used a method of finding the node values ​​by exporting it in Patran format. Thanks again for your efforts.

 

https://forums.autodesk.com/t5/moldflow-insight-forum/vb-script-exporting-all-fiber-orientation-tens...

Message 4 of 5
bernor_mf
in reply to: php5QCWQ

@php5QCWQ 

Hi,
Good you found a workaround and a solution. 😊

Followed the link, and found I did a post there 7 years ago (!). 😳
And I am still hanging around here... 🤔

 

Using the Patran export and reading file could be time consuming.
But with today's machines it might be okay.

I would like to highlight another option.
WarpQueryNode()

◆ WarpQueryNode()



Boolean WarpQueryNode  ( long  aNodeID,  
  long  aAnchorIndex,  
  Object  aRetValues  
 )   


Queries on a node 
Parameters
aNodeID data set id  
aAnchorIndex anchor plane index. If the index is invalid, only the displacement components in global coordinate system are returned  
aRetValues returned query values (node coordinates and displacements in global and local coordinate systems)  

Note: If anchor plane is specified, the return array contains 18 values which are the following values: 
 Index 0, 1, 2: X, Y, Z coordinates in global coordinate system before deflection 
 Index 3, 4, 5: X, Y, Z coordinates in global coordinate system after deflection 
 Index 6, 7, 8: X, Y, Z coordinates in local coordinate system before deflection 
 Index 9, 10, 11: X, Y, Z coordinates in local coordinate system after deflection 
 Index 12, 13, 14: X, Y, Z displacement components in global coordinate system 
 Index 15, 16, 17: X, Y, Z displacement components in local coordinate system 
 otherwise, the return array contains 9 values which are the following values: 
 Index 0, 1, 2: X, Y, Z coordinates in global coordinate system before deflection 
 Index 3, 4, 5: X, Y, Z coordinates in global coordinate system after deflection 
 Index 6, 7, 8: X, Y, Z displacement components in global coordinate system
ReturnsTrue if successful 
'Example:This example queries displacement values in the first anchor plane on node 100 
Dim SynergyGetter, Synergy
On Error Resume Next
Set SynergyGetter = GetObject(CreateObject("WScript.Shell").ExpandEnvironmentStrings("%SAInstance%"))
On Error GoTo 0
If (Not IsEmpty(SynergyGetter)) Then
  Set Synergy = SynergyGetter.GetSASynergy
Else
  Set Synergy = CreateObject("synergy.Synergy")
End If
Set PlotMgr = Synergy.PlotManager()
Set queryValues = Synergy.CreateDoubleArray()
PlotMgr.WarpQueryBegin 6250, Nothing
PlotMgr.WarpQueryNode 100, 1, queryValues
PlotMgr.WarpQueryEnd 

 

Might be a way to resolve the issue too.

Regards,
Berndt

( If my comments are accepted, provide "Kudos" as appreciation. If your request is answered/resolved, please click the "Accept as Solution" button. Thanks.)
Message 5 of 5
bernor_mf
in reply to: php5QCWQ

@php5QCWQ 

Hi,

Just wanted to add another tip.
If you have the same original study and node numbering, and run different studies you could lock the plot results.

So if a Deflection, all Effects, Path Plot, with Vector X Component (Vx), is in first study, open the second or more,

and Lock All Plots. 
This will align the plot to have Vx result for all.
Might be useful to "copy" result setup from one study to another.

 

Regards,

Berndt

( If my comments are accepted, provide "Kudos" as appreciation. If your request is answered/resolved, please click the "Accept as Solution" button. Thanks.)
Tags (2)

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

Post to forums  

Autodesk Design & Make Report