Creates a new Truss.
Namespace: Autodesk.Revit.DB.StructureAssembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntaxpublic static Truss Create(
Document document,
ElementId trussTypeId,
ElementId sketchPlaneId,
Curve curve
)
Public Shared Function Create (
document As Document,
trussTypeId As ElementId,
sketchPlaneId As ElementId,
curve As Curve
) As Truss
public:
static Truss^ Create(
Document^ document,
ElementId^ trussTypeId,
ElementId^ sketchPlaneId,
Curve^ curve
)
static member Create :
document : Document *
trussTypeId : ElementId *
sketchPlaneId : ElementId *
curve : Curve -> Truss
Parameters
- document Document
-
The document in which the new Truss is created.
- trussTypeId ElementId
-
Element id of the truss type.
- sketchPlaneId ElementId
-
Element id of a SketchPlane.
- curve Curve
-
The curve of the truss element.
It must be a line, must not be a vertical line, and must be within the sketch plane.
Return Value
Truss
ExceptionsException | Condition |
---|
ArgumentException |
The input curve points to a helical curve and is not supported for this operation.
-or-
The element id should refer to a valid TrussType.
-or-
The element id should refer to a valid SketchPlane.
-or-
The curve is invalid to be the base curve of a truss.
|
ArgumentNullException |
A non-optional argument was null
|
InvalidOperationException |
This function is only enabled in Revit Structure and Revit Architecture.
-or-
Failed to create Truss element.
|
See Also