Create Method (Document, String, ElementId, DirectShapeTypeOptions)


Creates a DirectShapeType element.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2021

Syntax

C#
public static DirectShapeType Create(
	Document document,
	string name,
	ElementId categoryId,
	DirectShapeTypeOptions options
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	name As String, _
	categoryId As ElementId, _
	options As DirectShapeTypeOptions _
) As DirectShapeType
Visual C++
public:
static DirectShapeType^ Create(
	Document^ document, 
	String^ name, 
	ElementId^ categoryId, 
	DirectShapeTypeOptions^ options
)

Parameters

document
Type: Autodesk.Revit.DBDocument
Document to which the created element will be added.
name
Type: SystemString
Name of the DirectShapeType.
categoryId
Type: Autodesk.Revit.DBElementId
Id of the category assigned to this DirectShapeType. Must be a valid category id.
options
Type: Autodesk.Revit.DBDirectShapeTypeOptions
Options that can be used to control the behavior of DirectShapeType being created.

Return Value

The new DirectShapeType.

Exceptions

ExceptionCondition
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

See Also