Creates a DirectShape object and adds it to document.
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. See DirectShapeLibrary for more details.
This function is included for convenience. It essentially combines CreateGeometryInstance and CreateElement.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.484.0)
Since:
2015
Syntax
| C# |
|---|
[ObsoleteAttribute("This function will be obsolete in Revit 2017. Use the other DirectShape.CreateElementInstance instead. Use DirectShape.ApplicationId, DirectShape.ApplicationDataId properties to set application id and application data id.")]
public static DirectShape CreateElementInstance(
Document document,
ElementId typeId,
ElementId categoryId,
string definitionId,
Transform trf,
string applicationId,
string applicationDataId
) |
| Visual Basic |
|---|
<ObsoleteAttribute("This function will be obsolete in Revit 2017. Use the other DirectShape.CreateElementInstance instead. Use DirectShape.ApplicationId, DirectShape.ApplicationDataId properties to set application id and application data id.")> _
Public Shared Function CreateElementInstance ( _
document As Document, _
typeId As ElementId, _
categoryId As ElementId, _
definitionId As String, _
trf As Transform, _
applicationId As String, _
applicationDataId As String _
) As DirectShape |
| Visual C++ |
|---|
[ObsoleteAttribute(L"This function will be obsolete in Revit 2017. Use the other DirectShape.CreateElementInstance instead. Use DirectShape.ApplicationId, DirectShape.ApplicationDataId properties to set application id and application data id.")]
public:
static DirectShape^ CreateElementInstance(
Document^ document,
ElementId^ typeId,
ElementId^ categoryId,
String^ definitionId,
Transform^ trf,
String^ applicationId,
String^ applicationDataId
) |
Return Value
The created DirectShape object.
Remarks
Exceptions
See Also