AddDefinitionType Method


Add a definition to be reused by instances. Adding a definition type will change how the instances are created. When asked to create a definition, the library object will look for a corresponding type object. If one is found, it will create an instance of geometry stored in the type object. If it is not found, the library will look for a list of geometry objects stored as definition, and will copy and transform these to create an instance.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2015

Syntax

C#
public void AddDefinitionType(
	string id,
	ElementId typeId
)
Visual Basic
Public Sub AddDefinitionType ( _
	id As String, _
	typeId As ElementId _
)
Visual C++
public:
void AddDefinitionType(
	String^ id, 
	ElementId^ typeId
)

Parameters

id
Type: System String
ID of the definition to be added. Must be unique.
typeId
Type: Autodesk.Revit.DB ElementId
Element id of the DirectShapeType element that will be used as a definition.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →