Showing results for 
Search instead for 
Did you mean: 

Add custom header (tags) to NX TIFF.



W have created Tiff from NX Plot, But I want to add some user specific(header) informations to the TIFF. Is there any way to add the headers(private tags) to the TIFF images in NX?


Thank you.


Re: Add custom header (tags) to NX TIFF.

Valued Contributor
Valued Contributor



Does this help?

    Function CreateAnnotation(ByVal AnnotationText As String) As CAE.PostAnnotation

        Dim theSession As Session = Session.GetSession()
        Dim workSimPart As CAE.SimPart = CType(theSession.Parts.BaseWork, CAE.SimPart)
        Dim displaySimPart As CAE.SimPart = CType(theSession.Parts.BaseDisplay, CAE.SimPart)
        Dim theLW As NXOpen.ListingWindow = theSession.ListingWindow()
        theLW.WriteLine("In CreateAnnotation")
        ' The following line obtains the PostViewIds. In using the PostViewId later on, the first Id in the array is used.
        ' When working with multiple postviews at once, this could cause issues. At best only the first postview has the desired behaviour
        Dim PostViewIds() As Integer = theSession.Post.GetPostviewIds

        Dim postAnnotation1 As CAE.PostAnnotation
        Dim usertext1(0) As String
        usertext1(0) = AnnotationText
        'The names should be unique. Code should be added to check this.
        postAnnotation1 = theSession.Post.CreateAnnotation(PostViewIds(0), AnnotationText & "Name", 0.5, 0.05, usertext1)

        postAnnotation1.BoxTextAlignment = CAE.PostAnnotation.TextAlignment.Center

        postAnnotation1.TextColor = workSimPart.Colors.Find("Black")

        postAnnotation1.DrawBox = True

        postAnnotation1.BoxTranluceny = True

        postAnnotation1.BoxFill = True

        postAnnotation1.BoxColor = workSimPart.Colors.Find("White")


        Return postAnnotation1

        theLW.WriteLine("end of CreateAnnotation")

    End Function

'The annotation is written as a function which returns the created annotation and then the code should dispose this annotation after the image has been made.
'If annotation is written as a sub, somehow something keeps hanging in the session and makes NX crash after a few runs.
'Unknow why, but passing the created annotation through the function and then disposing it afterwards seems to do the trick.



Annotation = CreateAnnotation("What I want to see on screen")

To dispose of the annotation afterwards.