CHANGE COLOR VIA VB SCRIPT!!!!!!!!!! HELP!!!!
CHANGE COLOR VIA VB SCRIPT!!!!!!!!!! HELP!!!!
(OP)
I'm in need of assistance. I currently have a journal file that selects all faces and changes the color to 103. I now need to modify this journal file to have a select certain faces via user input ex. "Select objects". Is there anyone out there that can assist me with this or have any suggestions.
Also is there a way to create a button to easily access a journal file operation?
Attach is an copy of a stp file and the current vb script I created
Thanks,
Also is there a way to create a button to easily access a journal file operation?
Attach is an copy of a stp file and the current vb script I created
Thanks,





RE: CHANGE COLOR VIA VB SCRIPT!!!!!!!!!! HELP!!!!
For info on creating a custom button to start a journal, have a look here.
www.nxjournaling.com
RE: CHANGE COLOR VIA VB SCRIPT!!!!!!!!!! HELP!!!!
RE: CHANGE COLOR VIA VB SCRIPT!!!!!!!!!! HELP!!!!
CODE
Option Strict Off Imports System Imports NXOpen Imports NXOpen.UF Imports NXOpen.Utilities Imports NXOpen.Assemblies Imports System.Windows.Forms Imports System.IO Imports System.Collections Imports System.Collections.Generic Imports System.Environment Imports NXOpenUI Module Module6 Sub Main() Dim S As Session = Session.GetSession() Dim workPart As Part = S.Parts.Work Dim ufs As UFSession = UFSession.GetUFSession() Dim lw As ListingWindow = S.ListingWindow Dim layerColorID(256) As Integer layerColorID(1) = 6 Dim myFaces As New List(Of Face) If SelectFaces("select faces", myFaces) = Selection.Response.Cancel Then Exit Sub End If Dim displayModification1 As DisplayModification displayModification1 = S.DisplayManager.NewDisplayModification() 'displayModification1.NewColor = layerColorID(1) 'displayModification1.NewFont = DisplayableObject.ObjectFont.LongDashed displayModification1.NewWidth = DisplayableObject.ObjectWidth.Thick displayModification1.ApplyToAllFaces = False displayModification1.ApplyToOwningParts = False displayModification1.NewColor = 103 displayModification1.Apply(myFaces.ToArray) displayModification1.Dispose() End Sub Function SelectFaces(ByVal prompt As String, _ ByRef theFaces As List(Of Face)) As Selection.Response Dim theObjs() As NXObject Dim theUI As UI = UI.GetUI Dim typeArray() As Selection.SelectionType = _ {Selection.SelectionType.Faces} Dim resp As Selection.Response = theUI.SelectionManager.SelectObjects( _ prompt, "Selection", _ Selection.SelectionScope.AnyInAssembly, _ False, typeArray, theObjs) If resp = Selection.Response.ObjectSelected Or _ resp = Selection.Response.ObjectSelectedByName Or _ resp = Selection.Response.Ok Then For Each temp As Face In theObjs theFaces.Add(temp) Next Return Selection.Response.Ok Else Return Selection.Response.Cancel End If End Function End Modulewww.nxjournaling.com
RE: CHANGE COLOR VIA VB SCRIPT!!!!!!!!!! HELP!!!!
RE: CHANGE COLOR VIA VB SCRIPT!!!!!!!!!! HELP!!!!
It's possible to have the journal that open the color palette mask to select the right color ?
Thank you...
Using NX 8 and TC9.1