AlignPartByInsertionPoint Method


Align the part by its insertion point to a point and rotation in free space.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 18.0.0.0 (18.0.0.420)
Since: 2018

Syntax

C#
public static bool AlignPartByInsertionPoint(
	Document document,
	ElementId partId,
	XYZ position,
	double rotation,
	double rotationPerpendicular,
	double slope,
	FabricationPartJustification justification,
	Transform trf
)
Visual Basic
Public Shared Function AlignPartByInsertionPoint ( _
	document As Document, _
	partId As ElementId, _
	position As XYZ, _
	rotation As Double, _
	rotationPerpendicular As Double, _
	slope As Double, _
	justification As FabricationPartJustification, _
	trf As Transform _
) As Boolean
Visual C++
public:
static bool AlignPartByInsertionPoint(
	Document^ document, 
	ElementId^ partId, 
	XYZ^ position, 
	double rotation, 
	double rotationPerpendicular, 
	double slope, 
	FabricationPartJustification justification, 
	Transform^ trf
)

Parameters

document
Type: Autodesk.Revit.DB Document
The document.
partId
Type: Autodesk.Revit.DB ElementId
The element identifier of the part to align.
position
Type: Autodesk.Revit.DB XYZ
The position to move the part's insertion point to.
rotation
Type: System Double
The rotation in radians.
rotationPerpendicular
Type: System Double
The perpendicular rotation for free placement around the Y axis direction of connection - angle in radians.
slope
Type: System 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.
justification
Type: Autodesk.Revit.DB.Fabrication FabricationPartJustification
The justification to align eccentric parts.
trf
Type: Autodesk.Revit.DB Transform
Optional alignment transformation matrix, eg. a Trf that describes plan or side elevation.

Return Value

True if the alignment succeeds, false otherwise.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The element is not a fabrication part. -or- Not all of the fabrication part's connectors are open.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration

See Also