Revit 2025 API
Direct |
Creates a copy of a definition shape that was created earlier.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static IList<GeometryObject> CreateGeometryInstance( Document document, string definition_id, Transform trf )
Public Shared Function CreateGeometryInstance ( document As Document, definition_id As String, trf As Transform ) As IList(Of GeometryObject)
public: static IList<GeometryObject^>^ CreateGeometryInstance( Document^ document, String^ definition_id, Transform^ trf )
static member CreateGeometryInstance : document : Document * definition_id : string * trf : Transform -> IList<GeometryObject>
Parameters
- document Document
- Document to which the created element will be added
- definition_id String
- ID of the shape definition that was created earlier and stored via DirectShapeLibrary
- trf Transform
- Transform to be applied to the definition
Return Value
IListGeometryObjectA collection of GeometryObjects representing a placed instance of the pre-defined shape The caller function takes ownership

Exception | Condition |
---|---|
ArgumentNullException | A non-optional argument was null |

Use DirectShapeLibrary class to store definitions prior to using them here.
How the definitions are stored will determine whether an instance or a copy of the shape will be created.
Use the output of this function as input to CreateElement to make the created shape persistent.
This is intended to support a definition/instance pattern common in CAD formats - DWG blocks, STEP MAPPED_ITEM, IFC IfcMappedItem.
See Also