2027 Method
Changes 0
M

FabricationPart.AlignPartByInsertionPointAndCutInToStraight

Description:
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.
public static bool AlignPartByInsertionPointAndCutInToStraight(
	Document document,
	ElementId straightId,
	ElementId partId,
	XYZ position,
	double rotation,
	double slope,
	bool flip
)
  • document
    The document.
  • straightId
    The element identifier of the straight to be cut in to.
  • partId
    The element identifier of the part to align and cut in with.
  • position
    The position to move the parts insertion point to.
  • Double
    rotation
    The rotation in radians.
  • Double
    slope
    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.
  • Boolean
    flip
    Flip the part to allow for flow direction.
Return Value Boolean True if the alignment succeeds, false otherwise.
  • 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.
  • A non-optional argument was null
  • Failed to align the part to the straight to cut in to.