output from function AskNMinMaxLocation() ?

To all

I am testing/playing with the function AskNMinMaxLocation(), see below, and struggling to understand how to define the output ByRef location As Result.Location. Could anyone enlighten me as my vb skills are limited

I am also not sure how does one request results for a specific set of elements. As part of another test I have managed to create a list of FEElement extracted from a user specified group and I can't figure out where to use this list (I only want the "top 10" for these elements!). Reading a bit it seems the function AskNMinMaxLocation() ask for the N extreme Min and Max values and the location of current result state defined by ResultParameters . I therefore had a look at ResultParameters, which I use in my function

Function GetResultAccess(ByRef results As CAE.Result, _
ByVal loadCaseIdx As Integer, _
ByVal iterationIdx As Integer, _
ByVal scale As Double) As CAE.ResultAccess

but there is nothing in the doc that I can see regarding defining/getting result for a given set of elements

Thanks
Regards

Public Sub AskNMinMaxLocation ( _
numExtreme As Integer, _
ByRef location As Result.Location, _
ByRef min As Double(), _
ByRef max As Double(), _
ByRef minID As Integer(), _
ByRef minSubID As Integer(), _
ByRef maxID As Integer(), _
ByRef maxSubID As Integer() )

What I have so far is as follow (some variables are defined but not used yet!)
At the moment NX does not like the way I defined Dim location As Result.Location

Sub ProcessData()

Dim i,j,k As Integer

Dim theSimPart As CAE.SimPart = theSession.Parts.BaseWork
Dim theCAEPart As CAE.CaePart
theCAEPart = CType(theSimPart, CAE.CaePart)

Dim theFEElmLabelMap As CAE.FEElementLabelMap = theSimPart.Simulation.Femodel.FeelementLabelMap

Dim satheGroupSelection() As String
Dim satheNModesSelection() As String
satheGroupSelection(0)="mygroup1"
satheNModesSelection(0)="1:Mode 1, 9999 Hz"

Dim theInputSOL103RSName As String ="mySOL103RS"

Dim iIterID As Integer = 1 'Iteration in the the load case i.e the nmode ID

Dim thesimulation As CAE.SimSimulation = theSimPart.Simulation()
Dim theTargetSolution As CAE.SimSolution = CType(thesimulation.FindObject("Solution[" & theInputSOL103RSName & "]"), CAE.SimSolution)
Dim results As CAE.Result = GetResults(theTargetSolution)

'access the (VM stress)result for the given nmode
Dim theAccessedResult As CAE.ResultAccess = GetResultAccess(results,0,iIterID,1.0)

Dim iTopNValue As integer =10
Dim location As Result.Location
Dim min(),max() As Double
Dim minID(),minSubID(),maxID(),maxSubID() As Integer

theAccessedResult.AskNMinMaxLocation(iTopNValue,location,min,max,minID,minSubID,maxID,maxSubID)

Dim theTaggedObjects(iTopNValue-1) As TaggedObject

For i = 0 to iTopNValue-1
theLW.WriteLine("Rank " & (i+1).ToString & ": max ID is:-" & maxID(i).ToString)
'convert the Elem ID returned into a CAE.Feelement
Dim theFEElm As CAE.FEElement=theFEElmLabelMap.GetElement(maxID(i))
theTaggedObjects(i) = theFEElm
Next

End Sub

answer appears to be:

Dim iTopNValue As Integer =10
Dim location As CAE.Result.Location = CAE.Result.Location.ElementNodal
Dim min, max As Double()
Dim minID,minSubID,maxID,maxSubID As Integer()

theAccessedResult.AskNMinMaxLocation(iTopNValue,location,min, max, minID, minSubID,maxID,maxSubID)

Thanks
Regards