Assign render materials using Journal ?
Assign render materials using Journal ?
(OP)
I am posting this question on this forum also, hoping to find new readers... 
Any tips on workarounds to assign , say "steel", to a body/all bodies in the work part using a journal ?
Note: Render materials. The "engineering materials" are no problem to assign using a journal.
The render materials palette (NX10) does not seem to register journal recording.
Any workarounds , other methods, to assign render materials are welcome.
The drag-drop from the materials palette does not record in the journal.
- Possible to import .lwa files ? Assign material from ?
- Cowski ?
Regards,
Tomas
Any tips on workarounds to assign , say "steel", to a body/all bodies in the work part using a journal ?
Note: Render materials. The "engineering materials" are no problem to assign using a journal.
The render materials palette (NX10) does not seem to register journal recording.
Any workarounds , other methods, to assign render materials are welcome.
The drag-drop from the materials palette does not record in the journal.
- Possible to import .lwa files ? Assign material from ?
- Cowski ?
Regards,
Tomas





RE: Assign render materials using Journal ?
To open an LWA material library use
CODE -->
It is then possible to copy a material from the library to work part, which gives the material_tag
CODE -->
Then use the assign material function
CODE -->
The only example for studio materials I could find on GTAC shows how one can use cycle objects to find all materials in a part.
CODE -->
Option Strict Off Imports System Imports System.Collections Imports NXOpen Imports NXOpen.UF Module report_studio_materials_in_part Dim theSession As Session = Session.GetSession() Dim ufs As UFSession = UFSession.GetUFSession() Dim theUI As UI = UI.GetUI() Dim lw As ListingWindow = theSession.ListingWindow Sub Main Dim materials As New SortedList() get_part_materials(materials) lw.Open() If materials.Count = 0 Then lw.WriteLine("Part has no materials applied.") Else For Each material As DictionaryEntry in materials lw.WriteLine("Part Material " + material.Key.ToString() + " is " + material.Value) Next End If End Sub Function get_part_materials(ByRef materials As SortedList) Dim matTag As Tag = Tag.Null ufs.Obj.CycleObjsInPart ( theSession.Parts.Work.Tag, _ UFConstants.UF_material_type, _ matTag) While matTag <> Tag.Null Dim matName As String = Nothing ufs.Obj.AskName(matTag, matName) materials.Add(matTag, matName) ufs.Obj.CycleObjsInPart ( theSession.Parts.Work.Tag, _ UFConstants.UF_material_type, _ matTag) End While End Function End Module