rootek
Mechanical
- Oct 21, 2013
- 5
Hello,
I have a little problem. I want to make macro which colors extruded bodies to line's color from which this body was created.
Let's say I have a triangle wchich I extruded. The color of extruded body is, by default, grey. The lines color is, for example, green.
How to, using macro, color extruded body to green.
I was trying code below, but msgbox(...) shows me 134 (default blue color) regardless of what lines' color I set.
---
rootek
I have a little problem. I want to make macro which colors extruded bodies to line's color from which this body was created.
Let's say I have a triangle wchich I extruded. The color of extruded body is, by default, grey. The lines color is, for example, green.
How to, using macro, color extruded body to green.
I was trying code below, but msgbox(...) shows me 134 (default blue color) regardless of what lines' color I set.
Code:
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main
Dim TheSession As Session = Session.GetSession()
Dim objectArray1(0) As DisplayableObject
Dim workPart As Part = theSession.Parts.Work
Dim TempBody As NXOpen.Body
Dim TempFeatures() As NXOpen.Features.Feature
Dim TFeature As NXOpen.Features.Feature
Dim TempSection() As NXOpen.Section
Dim Tempobj() As NXobject
For Each TempBody In workPart.Bodies
TempFeatures = TempBody.GetFeatures
TFeature = TempFeatures(0)
TempSection = TFeature.GetSections
TempSection(0).GetOutputCurves(Tempobj)
Dim line2 As Line = CType(Tempobj(3), Line)
msgbox(line2.color)
Next
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module
---
rootek