RevisionCloudCreate Method

Creates a new RevisionCloud in the model.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static RevisionCloud Create(
	Document document,
	View view,
	ElementId revisionId,
	IList<Curve> curves
)

Parameters

document  Document
The document in which the RevisionCloud should be created.
view  View
The View in which the RevisionCloud should appear.
revisionId  ElementId
The Revision to associate with the new RevisionCloud.
curves  IListCurve
The curves that will form the RevisionCloud's sketch.

Return Value

RevisionCloud
The newly created RevisionCloud.
Exceptions
ExceptionCondition
ArgumentException document is not a project document. -or- revisionId is not a valid Revision. -or- This operation cannot be performed because revisionId is an issued Revision. -or- view is not a View that can support RevisionClouds. -or- The provided Curves curves cannot be used as the basis for a RevisionCloud. Either the list is empty or one or more of the Curves could not be projected onto the View's plane.
ArgumentNullException A non-optional argument was null
Remarks
Creates a new RevisionCloud in the specified View. The new RevisionCloud will be associated with the specified Revision. RevisionClouds can only be created if the Revision has not yet been issued.

RevisionClouds can be created in most graphical Views, excepting 3D views and graphical column schedules. Unlike most other Elements, RevisionClouds can be created directly on a ViewSheet.

RevisionClouds are created based on a series of sketched curves. There is no requirement that the curves form closed loops and self-intersections are also permitted. The curves will be automatically projected onto the appropriate plane for the View. The list of curves cannot be empty and any lines cannot be perpendicular to the View's plane. If the View is a model View, the coordinates specified for the curves will be interpreted in model space. If the View is a non-model View (such as a ViewSheet) then the coordinates will be interpreted in the View's space.

The cloud graphics will be attached to the curves under the assumption that each curve is oriented in a clockwise direction. For lines, this means that the outside of the cloud is in the direction of the line's normal vector within the View's plane. Any closed loops should therefore be oriented clockwise to create the typical cloud shape.

Example
private void CreateRevisionCloudInActiveView(Document document, Revision revision, IList<Curve> curves)
{
    using (Transaction newRevisionCloud = new Transaction(document, "Create Revision Cloud"))
    {
        newRevisionCloud.Start();
        // Can only create revision cloud for revision that is not issued
        if (revision.Issued == false)
        {
            RevisionCloud.Create(document, document.ActiveView, revision.Id, curves);
            newRevisionCloud.Commit();
        }
        else
        {
            newRevisionCloud.RollBack();
        }
    }
}
See Also