Namespace:
Autodesk.Revit.DB
SketchPlane
Class
Description:
Represents a sketch plane or work plane.
Represents a sketch plane or work plane.
Remarks:
A SketchPlane object is used as an input to creation of sketch-referencing elements such as Model Curves or sketch-owning elements such as Generic Forms. The SketchPlane can be obtained from an existing element or created from a geometric plane or planar face. Note that the sketch plane element passed as input to create an element may not be the actual sketch plane assigned to that element; Revit may look for a geometrically equivalent plane to use, or may create a new one if the input plane is already used for other purposes. Some sketch planes (such as those obtained from detail curves) are suitable only for use in creating detail elements; they will be rejected when used for other element types.
A SketchPlane object is used as an input to creation of sketch-referencing elements such as Model Curves or sketch-owning elements such as Generic Forms. The SketchPlane can be obtained from an existing element or created from a geometric plane or planar face. Note that the sketch plane element passed as input to create an element may not be the actual sketch plane assigned to that element; Revit may look for a geometrically equivalent plane to use, or may create a new one if the input plane is already used for other purposes. Some sketch planes (such as those obtained from detail curves) are suitable only for use in creating detail elements; they will be rejected when used for other element types.
Examples
public void ShowSketchPlane(SketchPlane sketchPlane)
{
// get the information of the created sketch plane
string information = "Sketch Plane: ";
//get the corresponding Plane
Autodesk.Revit.DB.Plane plane = sketchPlane.GetPlane();
//show the plane's origin point
information += "\norigin of the plane: " + XYZToString(plane.Origin);
//show the plane's normal vector
information += "\nnormal of the plane: " + XYZToString(plane.Normal);
//show the plane's Xvec vector
information += "\nXvec of the plane: (" + XYZToString(plane.XVec);
//show the plane's Yvec vector
information += "\nYvec of the plane: (" + XYZToString(plane.YVec);
TaskDialog.Show("Revit",information);
}
// output the point's three coordinates
string XYZToString(XYZ point)
{
return "(" + point.X + ", " + point.Y + ", " + point.Z + ")";
}