VB.Net BOM Structure state for radio button

VB.Net BOM Structure state for radio button

j.romoYDW7Q
Contributor Contributor
166 Views
1 Reply
Message 1 of 2

VB.Net BOM Structure state for radio button

j.romoYDW7Q
Contributor
Contributor

Hello,

I have a small code for changing the BOM State of my .ipt but when the API is activated and the windows Form is on, I cant have the current state of the BOM on the radio buttons.

I would like to get the current state of the part ex. Part is in Normal state the radio button normal is checked.

so the radio button of normal is checked at the start of the API.

Here is my code

 Private Sub compradaRADIOBTN_Checked(sender As Object, e As RoutedEventArgs) Handles compradaRADIOBTN.Checked


     If compradaRADIOBTN.IsChecked Then
         normalRDIOBTN.IsChecked = False
         MsgBox("Purchased state on")
         oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kPurchasedBOMStructure
     Else
         MsgBox("Normal state On")
         oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kNormalBOMStructure
     End If
 End Sub

 Private Sub normalRDIOBTN_Checked(sender As Object, e As RoutedEventArgs) Handles normalRDIOBTN.Checked
     If normalRDIOBTN.IsChecked Then
         compradaRADIOBTN.IsChecked = False

     End If
 End Sub

 Thanks in advance

0 Likes
167 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @j.romoYDW7Q.  I do not recognize the Event you are attempting to handle in your code example.  When I look at the official documentation for the RadioButton control, there is a long list of Events available, but none shown are simply called 'Checked'.  Checked is a Property of the RadioButton, not an Event.  There is an Event called 'CheckedChanged', and one called 'Click', which are likely the two most commonly used though.  The CheckedChanged event is raised when the Checked property's value is changed.  That is likely the one you would want to monitor.  It just tells you that the value changed though, not the current value.  It also looks like you are attempting to use a property named 'IsChecked', but I believe that is also wrong.  There is no property by that name, but there is the one mentioned above, simply called Checked.  That is what you want to check the value of, to see which one is now checked, after the event.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes