2024 Method
Changes 0
M

DirectShape.CreateElementInstance

Description:
Creates a DirectShape object and adds it to document.
Remarks:
This function is included for convenience. It essentially combines CreateGeometryInstance and CreateElement. The shape stored in the element is either a reference or a copy of a definition shape that was created earlier. How the definitions are stored will determine whether an instance or a copy of the shape will be created. The intended use is to support a definition/instance pattern common in CAD formats - DWG blocks, STEP MAPPED_ITEM, IFC IfcMappedItem. Use DirectShapeLibrary class to store definitions prior to using them here.
public static DirectShape CreateElementInstance(
	Document document,
	ElementId typeId,
	ElementId categoryId,
	string definitionId,
	Transform trf
)
Return Value DirectShape The created DirectShape object.