I'm trying to get back to NXOPEN and the goal now is to generate the information of result probe.
The CAE.resultprobe.information does not return a value and It's not clear to me how to cycle through an entire list of result probes in a specific solution.
Any help would be apprciated.
Does the above discussion or solution helps your query? or Please be specific what you are trying to get from the info file.
I've seen this topic but I'm looking at something completely different.
I have a model with hundreds of probes defined. I want to automtically go over the entire list of probes in the active solution and write it to a text file (that is no problem) in a format of PROBE_NAME,PROBE_INFORMATION.
Assume a PCB modeled with solid meshes and tons of compoenents, and now get all the results for that..
The next step would be to start generating probes based on polygon geometry name, but that is AFTER I get the post processing done.
Do you have to use probe capability to do the result extraction you need?
I define a probe of maximum temperature over the polygon body which defines a componenet, and use that to extract the data, over many iterations or in steady state.
There is no other real option for doing that, unless SC had some built-in similar tools.
Sub Main() ... probeName = "combinedX" formula = "(X(""PT2"")+DX(""PT2""))-(X(""PT1"")+DX(""PT1""))" Call CreateResultProbe(aSolution, probeName, loadCase, loadcaseindex, formula) value(0) = ResultProbeValue(workSimPart, probeName) probeName = "combinedY" formula = "(Y(""PT2"")+DY(""PT2""))-(Y(""PT1"")+DY(""PT1""))" Call CreateResultProbe(aSolution, probeName, loadCase, loadcaseindex, formula) value(1) = ResultProbeValue(workSimPart, probeName) probeName = "combinedZ" formula = "(Z(""PT2"")+DZ(""PT2""))-(Z(""PT1"")+DZ(""PT1""))" Call CreateResultProbe(aSolution, probeName, loadCase, loadcaseindex, formula) value(2) = ResultProbeValue(workSimPart, probeName) ... End Sub Sub CreateResultProbe(ByVal simSolution1 As CAE.SimSolution, ByVal probeName As String, ByVal loadcase As Integer, ByVal loadcaseindex As Integer, ByVal formaula As String) Dim simResultReference1 As CAE.SimResultReference = simSolution1.Find("Structural") Dim solutionResult1 As CAE.SolutionResult = theSession.ResultManager.CreateReferenceResult(simResultReference1) Dim nullCAEResultProbe As CAE.ResultProbe = Nothing Dim nXObject1 As NXObject = Nothing Dim resultProbeBuilder1 As CAE.ResultProbeBuilder = Nothing resultProbeBuilder1 = simSolution1.CreateResultProbeBuilder(nullCAEResultProbe) resultProbeBuilder1.ProbeName = probeName resultProbeBuilder1.Loadcase = loadcase resultProbeBuilder1.LoadcaseIndex = loadcaseindex resultProbeBuilder1.ModelSelectionType = CAE.ResultProbeBuilder.SelectionType.None resultProbeBuilder1.ResultReferenceType = CAE.SimResultReference.Type.Structural resultProbeBuilder1.Formula = formaula nXObject1 = resultProbeBuilder1.Commit() resultProbeBuilder1.Destroy() End Sub Function ResultProbeValue(ByVal workSimPart As CAE.SimPart, ByVal probeName As String) Dim value As Double = Nothing Dim fieldManager1 As Fields.FieldManager = workSimPart.FieldManager Dim resultProbe1 As CAE.ResultProbe = CType(fieldManager1.FindObject(probeName), CAE.ResultProbe) Dim expression1 As Expression = workSimPart.Expressions.Create("tempFd=fd(""" & probeName & """)") value = expression1.Value workSimPart.Expressions.Delete(expression1) 'Required Return value End Function
Would this code work to extract a Result Probe value if it is only a single value?
I see the use of fields but, at least in the GUI, there is no way to save Result Probe Infromation to a field.