Creates a DirectShape object and adds it to document.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since: 2017
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- document
- Type: Autodesk.Revit.DBDocument
Document to which the created element will be added.
- categoryId
- Type: Autodesk.Revit.DBElementId
Id of the category assigned to this DirectShape. Must be a valid category id.
Return Value
The created DirectShape object.Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.ExceptionsArgumentException | Document document may not contain DirectShape or DirectShapeType objects. -or- Element id categoryId may not be used as a DirectShape category. |
Autodesk.Revit.ExceptionsArgumentNullException | A non-optional argument was null |