Sets the Revisions to additionally include in the sheet's revision schedules.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.1.0)
Since:
2015
Syntax
C# |
---|
public void SetAdditionalRevisionIds(
ICollection<ElementId> projectRevisionIds
) |
Visual Basic |
---|
Public Sub SetAdditionalRevisionIds ( _
projectRevisionIds As ICollection(Of ElementId) _
) |
Visual C++ |
---|
public:
void SetAdditionalRevisionIds(
ICollection<ElementId^>^ projectRevisionIds
) |
Parameters
- projectRevisionIds
- Type: System.Collections.Generic..::..ICollection<(Of <(<'ElementId>)>)>
The ids of Revisions to explicitly include in the sheet's revision schedules.
Remarks
Examples
CopyC#
public static void AddAdditionalRevisionsToSheet(ViewSheet viewSheet, String toMatch)
{
Document doc = viewSheet.Document;
ICollection<ElementId> revisions = viewSheet.GetAdditionalRevisionIds();
FilteredElementCollector collector = new FilteredElementCollector(doc);
collector.OfCategory(BuiltInCategory.OST_Revisions);
collector.WhereElementIsNotElementType();
if (revisions.Count > 0)
collector.Excluding(revisions);
foreach (Element revision in collector)
{
Parameter descriptionParam = revision.get_Parameter(BuiltInParameter.PROJECT_REVISION_REVISION_DESCRIPTION);
String description = descriptionParam.AsString();
if (description.Contains(toMatch))
revisions.Add(revision.Id);
}
if (revisions.Count > 0)
{
using (Transaction t = new Transaction(doc, "Add revisions to sheet"))
{
t.Start();
viewSheet.SetAdditionalRevisionIds(revisions);
t.Commit();
}
}
}
CopyVB.NET
Public Shared Sub AddAdditionalRevisionsToSheet(viewSheet As ViewSheet, toMatch As [String])
Dim doc As Document = viewSheet.Document
Dim revisions As ICollection(Of ElementId) = viewSheet.GetAdditionalRevisionIds()
Dim collector As New FilteredElementCollector(doc)
collector.OfCategory(BuiltInCategory.OST_Revisions)
collector.WhereElementIsNotElementType()
If revisions.Count > 0 Then
collector.Excluding(revisions)
End If
For Each revision As Element In collector
Dim descriptionParam As Parameter = revision.Parameter(BuiltInParameter.PROJECT_REVISION_REVISION_DESCRIPTION)
Dim description As [String] = descriptionParam.AsString()
If description.Contains(toMatch) Then
revisions.Add(revision.Id)
End If
Next
If revisions.Count > 0 Then
Using t As New Transaction(doc, "Add revisions to sheet")
t.Start()
viewSheet.SetAdditionalRevisionIds(revisions)
t.Commit()
End Using
End If
End Sub
Exceptions
See Also