TemporaryGraphicsManagerAddControl Method |
Creates an in-canvas control.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic int AddControl(
InCanvasControlData data,
ElementId ownerViewId
)
Public Function AddControl (
data As InCanvasControlData,
ownerViewId As ElementId
) As Integer
public:
int AddControl(
InCanvasControlData^ data,
ElementId^ ownerViewId
)
member AddControl :
data : InCanvasControlData *
ownerViewId : ElementId -> int
Parameters
- data InCanvasControlData
-
Data to generate in-canvas control appearance.
- ownerViewId ElementId
-
The view in which the control appears. It will show in all views if the id is invalidElementId.
Return Value
Int32
Unique index of control for future references.
Exceptions
RemarksThis method can perform drawing an image (supplied by the caller) as an in-canvas control in the view(s). The control can react on click
by invoking a callback defined in [!:Autodesk::Revit::UI::ITemporaryGraphicsHandler::OnClick(TemporaryGraphicsCommandData)].
The caller can use the returned index to update the control (changing image/location), delete and change visibility (hide/unhide) in
response to any events later.
See Also