Revision |
public static RevisionCloud Create( Document document, View view, ElementId revisionId, IList<Curve> curves )
Exception | Condition |
---|---|
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 |
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.
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(); } } }