@Anonymous wrote:
For instance, if you have a push button that needs to react in the same manner as the text box, you might be able to use an availability class for the former and then add some kind of event handler to react to changes to its state and propagate those to the text box.
Thanks Jeremy. As always, you've put me on the right track. I was simply overthinking my solutions. I created an IExternalCommandAvailability that I apply to my PushButtons that now sets my TextBox.Enabled = false, when ActiveUIDocument == null.
I use the code below and store my created TextBox in variable: Variables.ribbonTextBox, and I assign the "myNameSpace.DocumentRequired" to my PushButtonData.AvailabilityClassName.
public class Variables
{
public static RibbonItem ribbonTextBox = null;
}
public class DocumentRequired : IExternalCommandAvailability
{
public bool IsCommandAvailable(UIApplication a, CategorySet b)
{
bool val = true;
if (a.ActiveUIDocument == null)
val = false;
Variables.FamilySeekTextBox.Enabled = val;
return val;
}
}
Thanks!!
Anthony Tiefenbach
BIM Manager
HuntonBrady Architects