Thank you for the suggestion. I don’t think this solves the problem, though.
If the checkbox is checked, I want the other controls to be disabled. Simply changing the
!= in the code you provided doesn’t seem to work. It was my understanding that this is why a Boolean IValueConverter is needed.
I also tried this code to set
IsEnabled based on either possible value of
def cb_createformwork_Click(self, sender, e):
self.tb_thickness.IsEnabled = False
self.tb_thickness.IsEnabled = True
While this works, I also want to get the initial value of the checkbox from a Yes/No shared parameter of the Revit element the user has selected. I am struggling with how to set
IsEnabled for all of the Window components based on the initial value of that shared parameter.
My script is intended to be a way for certain users to be able to edit and override the values of shared parameters which have
UserModifiable set to No. Here is the flow of my script:
- User selects instance of element to edit in Revit and runs script
- Script reads current values of element’s shared parameters and displays them in textboxes and checkboxes
- If the value of a Yes/No shared parameter called
auto_set is YES, all other textboxes’ and checkboxes’
IsEnabled properties should be set to
auto_set parameter is used by other scripts to determine if the element should be updated/skipped. I.e. has the user overridden this element’s parameter values)
- The user can then uncheck the CheckBox control showing the current value (YES) of the auto_set parameter to enable editing the values of all other controls.
- The user can click the “Submit” button to commit a transaction of all changes to the shared parameter values and close the window OR the user can click a “Reset” button to undo any changes they have made to the checkboxes and textboxes.
I hope that makes sense… Thanks again for the help.