Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

toggle disables group

Hello,

i'm new in programming.

I have created a dialog by using the Block ui styler of NX.

Dialog.PNG

 

Here is a toggle in that enable/disable a other group of settings in this dialog.

How do i need to set the VB script that this is also happening?

 

do i need to place some scripting in this part:

    Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer
        Try
       
            If block Is Active_mode Then
            '---- Enter your code here -----
           
            ElseIf block Is Test1 Then
            '---- Enter your code here -----
           
            ElseIf block Is Test2 Then
            '---- Enter your code here -----
           
            End If
       

 

 

Thanks for the tips.

 

 


Ruud van den Brand
Pre-sales NX CAD
cards PLM Solutions
3 REPLIES

Re: toggle disables group

if you are asking if this is the place to put some to do something everytime the user clicks on a toggle then yes

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
Solution
Solution
Accepted by topic author ruud_vandenbrand
‎07-05-2017 05:30 AM

Re: toggle disables group

You'll want to add the following line in a couple of places: group.Show = toggle0.Value

 

First, in the update callback, to capture any interactive changes:

 

    Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer
        Try
        
            If block Is toggle0 Then
            '---- Enter your code here -----
                group.Show = toggle0.Value
            
            ElseIf block Is toggle01 Then
            '---- Enter your code here -----
            
            ElseIf block Is toggle02 Then
            '---- Enter your code here -----
            
            End If
        
        Catch ex As Exception
        
            '---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
        update_cb = 0
    End Function

 

And also in the dialog shown callback, so that the dialog is loaded in the correct state:

 

    Public Sub dialogShown_cb()
        Try
        
            '---- Enter your callback code here -----
            group.Show = toggle0.Value
 
        Catch ex As Exception
        
            '---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
    End Sub

Re: toggle disables group

Thanks for the response.

i'm going to test this and let you know if it works

Ruud van den Brand
Pre-sales NX CAD
cards PLM Solutions