FabricationPartAlignPartByInsertionPointAndCutInToStraight Method |
Align the part by its insertion point to a point and rotation on a straight. This will automatically size and connect the part being cut into, if possible.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static bool AlignPartByInsertionPointAndCutInToStraight(
Document document,
ElementId straightId,
ElementId partId,
XYZ position,
double rotation,
double slope,
bool flip
)
Public Shared Function AlignPartByInsertionPointAndCutInToStraight (
document As Document,
straightId As ElementId,
partId As ElementId,
position As XYZ,
rotation As Double,
slope As Double,
flip As Boolean
) As Boolean
public:
static bool AlignPartByInsertionPointAndCutInToStraight(
Document^ document,
ElementId^ straightId,
ElementId^ partId,
XYZ^ position,
double rotation,
double slope,
bool flip
)
static member AlignPartByInsertionPointAndCutInToStraight :
document : Document *
straightId : ElementId *
partId : ElementId *
position : XYZ *
rotation : float *
slope : float *
flip : bool -> bool
Parameters
- document Document
-
The document.
- straightId ElementId
-
The element identifier of the straight to be cut in to.
- partId ElementId
-
The element identifier of the part to align and cut in with.
- position XYZ
-
The position to move the parts insertion point to.
- rotation Double
-
The rotation in radians.
- slope Double
-
The slope value to flex to match if possible in fractional units (eg.1/50). Positive values are up, negative are down. Slopes can only be applied
to fittings, whilst straights will inherit the slope from the piece it is connecting to.
- flip Boolean
-
Flip the part to allow for flow direction.
Return Value
Boolean
True if the alignment succeeds, false otherwise.
ExceptionsException | Condition |
---|
ArgumentException |
The element is not a fabrication part.
-or-
Not all of the fabrication part's connectors are open.
-or-
The part is not a straight.
-or-
The fabrication parts do not have matching domain types.
-or-
The position is not on the straight.
|
ArgumentNullException |
A non-optional argument was null
|
InvalidOperationException |
Failed to align the part to the straight to cut in to.
|
See Also