IExternalCommandAvailability Interface |
An interface that should be implemented to provide the implementation for a accessibility check for a Revit add-in External Command.
Namespace: Autodesk.Revit.UIAssembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic interface IExternalCommandAvailability
Public Interface IExternalCommandAvailability
public interface class IExternalCommandAvailability
type IExternalCommandAvailability = interface end
The IExternalCommandAvailability type exposes the following members.
Methods | Name | Description |
---|
 | IsCommandAvailable | Implement this method to provide control over whether your external command is enabled or disabled. |
Top
RemarksThis interface should share the same assembly with add-in External Command.
Examplepublic class SampleAccessibilityCheck : IExternalCommandAvailability
{
public bool IsCommandAvailable(Autodesk.Revit.UI.UIApplication applicationData,
CategorySet selectedCategories)
{
if (selectedCategories.IsEmpty)
return true;
foreach (Category c in selectedCategories)
{
if (c.BuiltInCategory == BuiltInCategory.OST_Walls)
return true;
}
return false;
}
}
Public Class SampleAccessibilityCheck
Implements IExternalCommandAvailability
Public Function IsCommandAvailable(applicationData As Autodesk.Revit.UI.UIApplication, selectedCategories As CategorySet) As Boolean Implements IExternalCommandAvailability.IsCommandAvailable
If selectedCategories.IsEmpty Then
Return True
End If
For Each c As Category In selectedCategories
If c.BuiltInCategory = BuiltInCategory.OST_Walls Then
Return True
End If
Next
Return False
End Function
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also