To rename datum features I've been trying to write a journal based upon information I've found on this forum.
I'm trying to rename a datum feature only when it has a specific attribute1 and rename it using an attribute2 that this datumplane already has.
This is the code I have until now:
Option Strict Off
Const attributeTitle As String = "GSDDIR"
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
For Each temp As TaggedObject In workPart.Datums
If TypeOf (temp) Is DatumPlane Then
Dim dPlane As DatumPlane = temp
'check for attribute
If dPlane.HasUserAttribute(attributeTitle,NXObject.AttributeType.String, -1) Then
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image when the NX session terminates
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
I'm not so experienced with writing journals so any help is very much appreciated.