TemporaryGraphicsManager.AddControl
Description:
Creates an in-canvas control.
Creates an in-canvas control.
Remarks:
This 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.
public int AddControl(
InCanvasControlData data,
ElementId ownerViewId
)
-
dataData to generate in-canvas control appearance.
-
ownerViewIdThe 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.
-
The ownerViewId provided is not an id of a view.
-
A non-optional argument was null
-
Failed to load the image from specified path.