CAM : NXMessageBox.Show
CAM : NXMessageBox.Show
(OP)
hello ,
i would like to put all operation name in a message box
Can you help me ?
i would like to put all operation name in a message box
Can you help me ?
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: CAM : NXMessageBox.Show
CODE
Dim theSession As Session = Session.GetSession() Dim theUISession As UI = UI.GetUI Dim response As Integer Dim operationName(1) As String = "" operationName(0) = "" theUISession.NXMessageBox.Show("Question", NXMessageBox.DialogType.Question, operationName)]RE: CAM : NXMessageBox.Show
CODE
Option Strict Off Imports System Imports System.Collections.Generic Imports NXOpen Imports NXOpen.CAM Module Module2 Sub Main(ByVal args As String()) Dim theSession As Session = Session.GetSession() Dim theUI As UI = UI.GetUI() Dim dispPart As Part = theSession.Parts.Display Dim lw As ListingWindow = theSession.ListingWindow lw.Open() Dim operationNames As New List(Of String) Dim opers As OperationCollection = dispPart.CAMSetup.CAMOperationCollection For Each oper As Operation In opers operationNames.Add(oper.Name) Next theUI.NXMessageBox.Show("Operation names", NXMessageBox.DialogType.Information, operationNames.ToArray) End Sub End Modulewww.nxjournaling.com
RE: CAM : NXMessageBox.Show
Mark Rief
NX CAM Customer Success
Siemens PLM Software
RE: CAM : NXMessageBox.Show
www.nxjournaling.com
RE: CAM : NXMessageBox.Show
A another question :
How you do , for just display the selection operation name and not all operations name ?
RE: CAM : NXMessageBox.Show
CODE
Option Strict Off Imports System Imports System.Collections.Generic Imports NXOpen Imports NXOpen.UF Imports NXOpen.CAM Module Module3 Sub Main(ByVal args As String()) Dim theSession As Session = Session.GetSession() Dim theUfSession As UFSession = UFSession.GetUFSession Dim theUI As UI = UI.GetUI() Dim dispPart As Part = theSession.Parts.Display Dim lw As ListingWindow = theSession.ListingWindow lw.Open() Dim setupTag As Tag = Tag.Null theUfSession.Cam.InitSession() theUfSession.Setup.AskSetup(setupTag) If setupTag = Tag.Null Then lw.WriteLine("no CAM setup, journal exiting") Return End If Dim operationNames As New List(Of String) Dim selectedCount As Integer Dim selectedTags() As Tag ' Get the selected nodes from the Operation Navigator theUfSession.UiOnt.AskSelectedNodes(selectedCount, selectedTags) If selectedCount = 0 Then theUI.NXMessageBox.Show("Selected Operations", NXMessageBox.DialogType.Information, "No operations were selected") Return End If For Each tempTag As Tag In selectedTags Dim tempOp As Operation Try tempOp = Utilities.NXObjectManager.Get(tempTag) operationNames.Add(tempOp.Name) Catch ex As NXException 'not an operation End Try Next If operationNames.Count = 0 Then theUI.NXMessageBox.Show("Selected Operations", NXMessageBox.DialogType.Information, "No operations were selected") Else theUI.NXMessageBox.Show("Selected Operations", NXMessageBox.DialogType.Information, operationNames.ToArray) End If End Sub End Modulewww.nxjournaling.com
RE: CAM : NXMessageBox.Show