By Aaron Lu
Again, use RevitLookup, we can see the related class is RevisionCloud, so the creation method is either in Document.Create or in the static methods of the class itself.
Fortunately, there is a static method called Create:
public static RevisionCloud Create(Document document, View view, ElementId revisionId, IList<Curve> curves)
We should know the meaning of most of the arguments, except revisionId, where can we get it?
I tried to pass ElementId.InvalidElementId, it throws:
Autodesk.Revit.Exceptions.ArgumentException: revisionId is not a valid Revision. Parameter name: revisionId
So we have to pass something meaningful.
At this moment, I found there is a property RevisionCloud.RevisionId which should be relevant, and that id is a Revision.
Inspect Revision, it also has a static Create method, now the solution is obvious, and simple:
var revision = Revision.Create(RevitDoc); var revisionCloud = RevisionCloud.Create(RevitDoc, RevitDoc.ActiveView, ElementId.InvalidElementId, new List<Curve>() { Line.CreateBound(XYZ.Zero, new XYZ(10,0,0)) });