Revit 2023 API |
ColorFillLegend..::..Create Method |
ColorFillLegend Class See Also |
Creates new instance of ColorFillLegend.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Since:
2022
Syntax
C# |
---|
public static ColorFillLegend Create( Document document, ElementId viewId, ElementId catetoryId, XYZ origin ) |
Visual Basic |
---|
Public Shared Function Create ( _ document As Document, _ viewId As ElementId, _ catetoryId As ElementId, _ origin As XYZ _ ) As ColorFillLegend |
Visual C++ |
---|
public: static ColorFillLegend^ Create( Document^ document, ElementId^ viewId, ElementId^ catetoryId, XYZ^ origin ) |
Parameters
- document
- Type: Autodesk.Revit.DB..::..Document
The document.
- viewId
- Type: Autodesk.Revit.DB..::..ElementId
The id of the view to place legend in.
- catetoryId
- Type: Autodesk.Revit.DB..::..ElementId
The id of category that color fill scheme belongs to.
- origin
- Type: Autodesk.Revit.DB..::..XYZ
The origin point of the legend, must be on the view plane.
Remarks
Use SupportedColorFillCategoryIds()()()() to get list of supported categories.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | document is not a project document. -or- There's no valid color fill scheme applied for catetoryId in viewId. -or- The origin is not on the view plane. |
Autodesk.Revit.Exceptions..::..ArgumentNullException | A non-optional argument was null |
Autodesk.Revit.Exceptions..::..ModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. |
Autodesk.Revit.Exceptions..::..ModificationOutsideTransactionException | The document has no open transaction. |