Query is related to a previous similar query. See link at end of the query. I have found this function in the doc and it might be doing what I am after i.e. extract the top 10 max value. I am however unsure on how to use it
Public Sub AskNMinMaxLocation ( _ numExtreme As Integer, _ <OutAttribute> ByRef location As Result.Location, _ <OutAttribute> ByRef min As Double(), _ <OutAttribute> ByRef max As Double(), _ <OutAttribute> ByRef minID As Integer(), _ <OutAttribute> ByRef minSubID As Integer(), _ <OutAttribute> ByRef maxID As Integer(), _ <OutAttribute> ByRef maxSubID As Integer() _ )
CAE.Result.Location will return where the result is defined. If it is an element-nodal result subIDs will be filled with node index and IDs will contain element index. For all other cases subIDs will be 0.
The question is the following
If one knows/has
how does one use the function AskNMinMaxLocation() to extract the VonMises stress?
Solved! Go to Solution.
DISCLAIMER: I have never programmed anything with CAE in NX :-)
but I think you have to go this way:
you need your session object (e.g. theSession) I think you know how to get it.
An this object has the function "AskNMinMaxLocation"
Do you know how to call this function?
you need something like:
Dim numExtreme As Integer = 10
Dim min As Double()
Dim max As Double()
Dim minID As Integer()
Dim minSubID As Integer()
Dim maxID As Integer()
Dim maxSubID As Integer()
yourResultAccessObject.AskNMinMaxLocation(numExtreme, min, max, minID, minSubID,maxID, maxSubID)
and then you have the values filled with your data.
Thanks for that josh. Mus appreciated. Seems obvious now that you point this out! Will try a bit later
I have already set up the result using
Dim results As CAE.Result = GetResults(solution)
and I have a function (not fully tested yet) to get the result access
Dim solResultsAccess As CAE.ResultAccess = theResultManager.CreateResultAccess(results, resultParameter) solResultsAccess.SetParameters(resultParameter) Return solResultsAccess
What I am not sure if what to set up the access only a specific list of elements. I am currently extracting the Von Mises stress result from a solution for a specific Load Case and iteration. I am assuming that the VM stress result returned contain the stress value of all the elements. I am only interested in a sub-set of these elements
Dim resultType As CAE.Result.Type resultType.Quantity = CAE.Result.Quantity.VonMisesStress resultType.Location = CAE.Result.Location.Nodal resultType.Section = CAE.Result.Section.NotApplicable
Was just about to test the suggestion when I realised that one of the output is "missing". The function AskNMinMaxLocation() requires
<OutAttribute> ByRef location As Result.Location
and cannot quite make sense of what NX wants. I have tried the following but it fails
Dim results As CAE.Result = GetResults(theTargetSolution) Dim theAccessedResult As CAE.ResultAccess = GetResultAccess(results,0,iIterID,1.0) Dim iTopNValue As Integer =10 Dim location As results.Location.Nodal Dim min, max As Double() Dim minID,minSubID,maxID,maxSubID As Integer() theAccessedResult.AskNMinMaxLocation(iTopNValue,location,min, max, minID, minSubID,maxID,maxSubID)
Thanks cowski1. Looks like it is working. Test program is failing a bit later but that's another problem!