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.
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.
Solved! Go to Solution.
Solved by bernor_mf. Go to Solution.
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
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.
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
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
Can't find what you're looking for? Ask the community or share your knowledge.