Showing results for 
Search instead for 
Do you mean 
Reply

Add custom header (tags) to NX TIFF.

[ Edited ]

Hi, 

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.

1 REPLY

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

Hello,

 

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.Open()
        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")

        postAnnotation1.Draw()

        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.

 

Use

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

To dispose of the annotation afterwards.

 

Regards,

Frederik