Code:
' NX 5.0.4.1
' Journal created by met on Tue Jun 24 16:19:47 2008 Westeuropäische Normalzeit
'
Option Strict Off
Imports System
Imports NXOpenModule NXJournal3
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim theUF As UF.UFSession = UF.UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
theSession.ListingWindow.Open()
Dim matTag As NXOpen.Tag = Tag.Null
Dim matName As String = ""
Dim bKugel As Body = workPart.Bodies.FindObject(workPart.Features.ToArray(8).JournalIdentifier)
theUF.Disp.AskMaterial(bKugel.Tag, matTag, matName)
theSession.ListingWindow.WriteLine("matTag: " & matTag)
theSession.ListingWindow.WriteLine("matName: " & matName)
Dim newMatTag As NXOpen.Tag = Tag.Null
Dim newMatName As String = ""
theUF.Disp.CopyMaterial(matTag, newMatTag, newMatName)
theSession.ListingWindow.WriteLine("newMatTag: " & newMatTag)
theSession.ListingWindow.WriteLine("newMatName: " & newMatName)
' *** Farbe setzen ***
'Dim clr_name As String = ""
'Dim clr_values As Double() = {255, 255, 255}
'Dim body1 As Body = workPart.Bodies.FindObject(workPart.Features.ToArray(8).JournalIdentifier)
'theUF.Disp.AskColor(body1.Color, 0, clr_name, clr_values)
'theSession.ListingWindow.WriteLine("clr_name: " & clr_name)
'theSession.ListingWindow.WriteLine("clr_values: " & clr_values(0) * 255 & " " & clr_values(1) * 255 & " " & clr_values(2) * 255)
'clr_values(0) = 1
'theUF.Disp.SetColor(body1.Color, 0, "Test", clr_values)
' *** Farbe setzen ***
End Sub
End Module