Forums:
Hi all!
I want to make question dialog with two buttons, that have custom labels: "Electrical port" and "Mechanical port". I have tried to use UF_UI MessageDialog Method, but it looks like i doing somthing totally wrong, because NX dose not show any dialog window, but i see message "building file selection dialog" at the bottom of the NX window. It is my code below, could you help me?
Option Strict Off Imports System Imports NXOpen Imports NXOpen.UFImports NXOpenUI Imports System.Runtime.InteropServices Module NXJournal Public theSession As Session = Session.GetSession()Public ufs As UFSession = UFSession.GetUFSession()Public lw As ListingWindow = theSession.ListingWindow Sub Main() Dim resp AsIntegerDim messages(0)AsString messages(0)="What type of port is highlighted"Dim but As UFUi.MessageButtons but.button1=True but.label1="Electrical port" but.response1=1 but.button2=True but.label2="Mechanical port" but.button3=False but.response1=2 MessDi("", UiMessageDialogType.UiMessageInformation, messages, 1, True, but, resp) lw.Open() lw.WriteLine("resp= "& resp) EndSub PublicSub MessDi( _ ByVal title_string AsString, _ ByVal dialog_type As UiMessageDialogType, _ ByVal messages AsString(), _ ByVal num_messages AsInteger, _ ByVal translate AsBoolean, _ ByRef buttons As UFUi.MessageButtons, _ <OutAttribute()>ByRef response AsInteger _ )EndSub PublicFunction GetUnloadOption(ByVal dummy AsString)AsInteger GetUnloadOption = NXOpen.Session.LibraryUnloadOption.ImmediatelyEndFunction EndModule