The ItemFactoryBase.NewReferencePlane() which helps create an instance of a ReferencePlane has two parameters called the BubbleEnd and FreeEnd? What do these parameters mean? The API documentation (RevitAPI.chm) only states that Bubble End parameter is the bubble end applied to reference plane – which is not very descriptive.
Here is some additional information on both of these parameters and what they refer to for each of the two NewReferencePlane(). The two methods that help create NewReferencePlane essentially use three points (which do not lie on a straight line) to construct a reference plane.
public ReferencePlane NewReferencePlane(
XYZ bubbleEnd,
XYZ freeEnd,
XYZ cutVec,
View pView
)
The freeEnd point is the origin of the new reference plane.
The vector-“bubbleEnd-freeEnd” is the x axis of the new plane.
The vector-“cutVec-freeEnd” will determine the y axis of the new plane.
The z axis (normal vector) will follow the right hand rule with the x and y axis.
<code>
XYZ bubbleEnd = gcnew XYZ( 0, 0, 0);
XYZ freeEnd = gcnew XYZ(-1, 0, 0);
XYZ cutVec = gcnew XYZ(0, 0, -1);
m_document.FamilyCreate.NewReferencePlane(bubbleEnd, freeEnd, cutVec, m_document.ActiveView);
</code>
AND
public ReferencePlane NewReferencePlane2(
XYZ bubbleEnd,
XYZ freeEnd,
XYZ thirdPt,
View pView
)
The freeEnd point is the origin of the new reference plane.
The vector-“bubbleEnd-freeEnd” is the x axis of the new plane.
The vector-“thirdPt-freeEnd” will determine the y axis of the new plane.
The z axis will follow the left hand rule with the x and y axis.
<code>
XYZ bubbleEnd = gcnew XYZ( 0, 0, 0);
XYZ freeEnd = gcnew XYZ(-1, 0, 0);
XYZ thirdPt = gcnew XYZ(0, 0, -1);
m_document.FamilyCreate.NewReferencePlane2(bubbleEnd, freeEnd, thirdPt, m_document.ActiveView);
</code>