Showing results for 
Search instead for 
Do you mean 

Universal File import to NX using API

Dear NX users,


TMG exports universal file and I would like to import node_temperature.unv file into NX  throught the API.   I've used with  FEMAP to do this tas and unfortunately,  there is  no import functionality for I-DEAS .unv files through the API.


Is there any way to import unv. file into NX throught the API for NX post-processing???

Please let me know if it's feasible in NX10


Many thanks,



Re: Universal File import to NX using API

Results data is never "imported" into NX.


Post Processing works directly with the data in the solver results file. Use NXOpen.CAE.ResultManager.CreateImportedResult() to create an instance of NXOpen.CAE.ImportedResult for the .unv file.

Re: Universal File import to NX using API

Hello Cats099,


I also use a lot of universal files. Please find below some example code where I specify a .unv file as a result.

I've also added some background in the attached file "README_.txt".


note: keep in mind that there are 2 ways to display .unv results in NX: 1) specify results file 2)add companion results. Both have pro's and cons.


Option Strict On
Imports System
Imports NXOpen

Module SpecifyResultsFile
    Public DEBUG As Boolean = True
    '  Explicit Activation
    '      This entry point is used to activate the application explicitly
    Sub Main(ByVal args() As String)
    		Dim SimFile As String
				SimFile = args(0)
				Dim myFile As String
				myFile = args(1)
    		Dim theSession As Session = Session.GetSession()
				Dim basePart1 As BasePart
				Dim partLoadStatus1 As PartLoadStatus
				'Open This Sim File
				basePart1 = theSession.Parts.OpenBaseDisplay(SimFile, partLoadStatus1)
				Dim workSimPart As CAE.SimPart = CType(theSession.Parts.BaseWork, CAE.SimPart)
				Dim displaySimPart As CAE.SimPart = CType(theSession.Parts.BaseDisplay, CAE.SimPart)
        'Don't forget to save the file!!
        Dim simPart1 As NXOpen.CAE.SimPart = CType(workSimPart, NXOpen.CAE.SimPart)
        Dim partSaveStatus1 As NXOpen.PartSaveStatus
        partSaveStatus1 = simPart1.Save(NXOpen.BasePart.SaveComponents.True, NXOpen.BasePart.CloseAfterSave.False)


    End Sub

    Sub Specify(ByVal Name 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 simSimulation1 As NXOpen.CAE.SimSimulation = CType(workSimPart.FindObject("Simulation"), NXOpen.CAE.SimSimulation)
        Dim simSolution1 As NXOpen.CAE.SimSolution = CType(simSimulation1.FindObject("Solution[Solution 1]"), NXOpen.CAE.SimSolution)
        Dim simResultReference1 As NXOpen.CAE.SimResultReference = CType(simSolution1.Find("Structural"), NXOpen.CAE.SimResultReference)

        Dim anyOf As Char() = "/\".ToCharArray()
        Dim Filename As String = Right(Name, (Name.Length - Name.LastIndexOfAny(anyOf)) - 1)
        Dim PathName() As String = Split(Name, Filename)

        If (DEBUG) Then
            Dim theLW As ListingWindow = theSession.ListingWindow()
        End If

        simResultReference1.SetLocalResultFile(PathName(0).Trim(anyOf), Filename)


    End Sub

    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image when the NX session terminates
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

        '----Other unload options-------
        'Unloads the image immediately after execution within NX
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

        'Unloads the image explicitly, via an unload dialog
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly

    End Function

End Module

Re: Universal File import to NX using API

A couple of suggestions:


  1. To be more robust, all .FindObject() calls should be replaced with more reliable selection methods. I.e. if there is no solution named "Solution 1", this journal will fail.
  2. Use methods in System.IO.Path to separate a file specification in to filename, pathname, extension, etc.



Re: Universal File import to NX using API

Hello Jim,


Thank you for your suggestions.

I will implement these.




Re: Universal File import to NX using API

Dear Frederik


Thanks for your suggestions. I will try it.

Best Regards,