cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using recorded journal files

Valued Contributor
Valued Contributor

Hello,

 

I recorded a journal file for exporting results to as unv-files. These results are generated by using the combined load case option.

I tried to use the recorded journal file on a secound model. I just changed the paths and output names in the file. Everything else is the same as in the recorded one, but I always get the following error:

 

Error Journal File.png

 

In NX 9 I got a similar message when I forgot to load the results in the post processing navigator, but I checked everything and also the results are loaded. I also unloaded and loaded the results and tried again, but I still get the same error.

Interesting thing is, that in the original file the export by using the journal file is working.

 

The line to which at the error is referred to is the following:

 

Dim nXObject1 As NXOpen.NXObject
nXObject1 = resultsEnvelopeBuilder1.Commit()

resultsEnvelopeBuilder1.Destroy()

 

Does anybody have an idea whats going wrong here?

 

Thanks and regards,

 

Georg

7 REPLIES

Re: Problem using recorded journal files

Siemens Phenom Siemens Phenom
Siemens Phenom

Georg,

 

It sounds like you are using a journal recorded in NX 9 with NX 10? If so, then this may be a migration issue. Sometimes the code changes between releases in ways that require journals and NX Open programs to be updated. I don't know if this is the case here, but wanted to point out that it is a possibility.

 

Regards,

Mark

 

Mark Lamping

Simulation Product Management

Product Engineering Software

 

Siemens Industry Sector

Siemens Product Lifecycle Management Software Inc.

mark.lamping@siemens.com

Re: Problem using recorded journal files

Valued Contributor
Valued Contributor
Hello Mark,

thanks for your answer.
No, this problem is independent from in which version the journal was recorded.
I tried by recording a new journal. It is running perfect in the model version I recorded it, but in an other version of the same model (everything is the same, solution structure, sub case structure and so on, just magnitudes of the loads are different) i tried to run it with just with the output names changed to the second model. It is no working.

It looks like everything is working, all the load collection and combination until the very end, but then suddenly NX is missing the results.

Regards,

Georg

Re: Problem using recorded journal files

Siemens Phenom Siemens Phenom
Siemens Phenom

Journals will typically only work "as-is" for the specific model they were recorded in. Some editing is required to make them more general for use in any model. This primarily involves modifying selection of model specific objects.

 

The first thing to look for is any calls to a FindObject() method. The input to this method is the journal identifier string of an object. You can find more information about this in Chapter 16 of the "Getting Started With Snap" guide (much of the content of this document is not specific to SNAP and applies equally well to NX Open).

 

The second thing to look for is any entity selection. If you select nodes, elements, faces, etc. at any step of the process, you will typically see a tagged object array being build with these objects added one at a time. These need to be replaced by a generic selection mechanism.

 

Since you are in post dealing with results, I'll also mention PostView ID's. Many calls in Post take the PostView ID as the first argument. In a recorded journal, these are hardcoded as integer values. You need to modify the code in this area to capture the postview ID that was generated when a postview was created as a variable. Then use this variable when calling downstream post methods.

 

I can't make any more specific recommendations without seeing the code in question.

Re: Problem using recorded journal files

Valued Contributor
Valued Contributor

Hello Jim,

 

unfortunately I am really bad in programming issues.

In my opinion the recorded journal file must work also for the second model, because it is exactly the same as the model in which it was generated.

I used this procedure already earlier in NX9 and it worked perfect.

 

Below please find the code of the journal file.

The only thing I am editing here are the namings "LC_F_1" e.g. to "LC_F_2" and of course additionally the path of the output file. \M1_Unten\ is changed to \M2_Unten\.

 

The error message for this journal file is reffering to line number 51:

 

nXObject1 = resultsCombinationBuilder1.Commit()

 

I also tried to generate the journal file for my second model and compared it to the manually edited file based on the journal file form model 1 and it is the exat same structure. 

Therefore I don´t understand why the manually edited journal file shouldn´t work.

 

' NX 10.0.0.24   ' Journal created by z0033yrc on Wed Feb 18 12:21:49 2015 Mitteleuropäische Zeit
Option Strict Off
Imports System
Imports NXOpen

Module NXJournal
Sub Main (ByVal args() As String) 

Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workSimPart As NXOpen.CAE.SimPart = CType(theSession.Parts.BaseWork, NXOpen.CAE.SimPart)
Dim displaySimPart As NXOpen.CAE.SimPart = CType(theSession.Parts.BaseDisplay, NXOpen.CAE.SimPart)
Dim markId1 As NXOpen.Session.UndoMarkId
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
theSession.SetUndoMarkName(markId1, "Results Combination Dialog")
Dim markId2 As NXOpen.Session.UndoMarkId
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Results Combination")
theSession.DeleteUndoMark(markId2, Nothing)
Dim markId3 As NXOpen.Session.UndoMarkId
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Results Combination")
Dim resultsCombinationBuilder1 As NXOpen.CAE.ResultsCombinationBuilder
resultsCombinationBuilder1 = theSession.ResultManager.CreateResultsCombinationBuilder()
Dim types1(0) As NXOpen.CAE.BaseResultType
Dim resultManager1 As NXOpen.CAE.ResultManager = CType(theSession.ResultManager, NXOpen.CAE.ResultManager)
Dim solutionResult1 As NXOpen.CAE.SolutionResult = CType(resultManager1.FindObject("SolutionResult[Master_B4_H800_assyfem_sim1.sim_Master_B4_H800]"), NXOpen.CAE.SolutionResult)
Dim loadcase1 As NXOpen.CAE.Loadcase = CType(solutionResult1.Find("Loadcase[159]"), NXOpen.CAE.Loadcase)
Dim iteration1 As NXOpen.CAE.Iteration = CType(loadcase1.Find("Iteration[1]"), NXOpen.CAE.Iteration)
Dim resultType1 As NXOpen.CAE.ResultType = CType(iteration1.Find("ResultType[[Stress][Element-Nodal]]"), NXOpen.CAE.ResultType)
types1(0) = resultType1
Dim names1(0) As String
names1(0) = "STRE"
Dim units1(0) As NXOpen.Unit
Dim unit1 As NXOpen.Unit = CType(workSimPart.UnitCollection.FindObject("StressMilliNewtonPerSquareMilliMeter"), NXOpen.Unit)
units1(0) = unit1
resultsCombinationBuilder1.SetResultTypes(types1, names1, units1)
resultsCombinationBuilder1.SetFormula("STRE")
resultsCombinationBuilder1.SetOutputResultType(NXOpen.CAE.ResultsManipulationBuilder.OutputResultType.Full)
resultsCombinationBuilder1.SetCreateSolution(False)
resultsCombinationBuilder1.SetImportResult(True)
resultsCombinationBuilder1.SetImportedSolutionName("LC_F_1")
resultsCombinationBuilder1.SetOutputQuantity(NXOpen.CAE.Result.Quantity.NXXShellResultant)
resultsCombinationBuilder1.SetOutputName("LC_F_1")
resultsCombinationBuilder1.SetLoadcaseName("LC_F_1")
resultsCombinationBuilder1.SetIncludeModel(True)
resultsCombinationBuilder1.SetOutputFile("F:\1_Projekte\Projects_2015\20150109_JSW_Torangallu_Ladle Turret B4 H800mm\NX\20_Turm\21_Drehturm_Original\HMB AA\M1_Unten_0\Export\LC_F_1.unv")
resultsCombinationBuilder1.SetUnitsSystem(NXOpen.CAE.ResultsManipulationBuilder.UnitsSystem.FromResult)
resultsCombinationBuilder1.SetUnitsSystemResult(solutionResult1)
resultsCombinationBuilder1.SetIncompatibleResultsOption(NXOpen.CAE.ResultsCombinationBuilder.IncompatibleResults.Skip)
resultsCombinationBuilder1.SetNoDataOption(NXOpen.CAE.ResultsCombinationBuilder.NoData.Skip)
resultsCombinationBuilder1.SetEvaluationErrorOption(NXOpen.CAE.ResultsCombinationBuilder.EvaluationError.Skip)
Dim nXObject1 As NXOpen.NXObject
nXObject1 = resultsCombinationBuilder1.Commit()
resultsCombinationBuilder1.Destroy()
theSession.DeleteUndoMark(markId3, Nothing)
theSession.SetUndoMarkName(markId1, "Results Combination")

End Sub
End Module

 Regards,

 

Georg

 

Re: Problem using recorded journal files

Siemens Phenom Siemens Phenom
Siemens Phenom

It's hard to debug without being able to run the code, but "Result File not found" sounds like a problem with:

 

Dim solutionResult1 As NXOpen.CAE.SolutionResult = CType(resultManager1.FindObject("SolutionResult[Master_B4_H800_assyfem_sim1.sim_Master_B4_H800]"), NXOpen.CAE.SolutionResult)

 

Is "Master_B4_H800_assyfem_sim1.sim_Master_B4_H800" the name of a solution? Did you modify this string between the file you recorded the journal in and the one you are running it in?

 

 

Re: Problem using recorded journal files

Valued Contributor
Valued Contributor

Jim,

 

thank you for your help.

Yes, this is the name of the solution. It is also the same in all other models.

For me also a hint that it must be the correct string is, that the journal file is starting. Otherwise it would abort immediatelly.

In my case the journal file is running through all the steps (loading the necessary subcase, combining results,...) but when it is finished (it is indicated in the bottom information bar by the blue bar is reaching 100%) and the exported file in the folder should be finalized suddenly this error message pops up and the procedure is canceld.

 

 

 

Re: Problem using recorded journal files

Valued Contributor
Valued Contributor

Hello guys,

 

thank you for your support on this topic.

Finaly I found the mistake. It was simply a wrong letter in the output path. Although it was the first thing I checked and I checked it several times afterwards I was not able to see it. But finally I recognized it though.

 

Thanks again.

 

Regards, 

 

Georg