RVTDocs.com
Namespace: Autodesk.Revit.DB Class: DirectShape

DirectShape.CreateElement

Method
Description:
Creates a DirectShape object and adds it to document.
Syntax
public static DirectShape CreateElement(
	Document document,
	ElementId categoryId
)
Parameters
Parameter Type Description
document Document Document to which the created element will be added.
categoryId ElementId Id of the category assigned to this DirectShape. Must be a valid category id.
Return Value
Type Description
DirectShape The created DirectShape object.
Exceptions
Exception Condition
ArgumentException Document document may not contain DirectShape or DirectShapeType objects. -or- Element id categoryId may not be used as a DirectShape category.
ArgumentNullException A non-optional argument was null