SketchPlane.Create(Document, Plane)
Method
Description:
Creates a new sketch plane from a geometric plane.
Creates a new sketch plane from a geometric plane.
Remarks:
There will not be a reference relationship established from the sketch plane to the input face. To create a SketchPlane with a reference to other geometry, use the overload with a Reference input.
There will not be a reference relationship established from the sketch plane to the input face. To create a SketchPlane with a reference to other geometry, use the overload with a Reference input.
Examples
public static SketchPlane CreateSketchPlane(Autodesk.Revit.DB.Document document, Plane plane)
{
SketchPlane sketchPlane = null;
// create a sketch plane using Geometry.Plane
sketchPlane = SketchPlane.Create(document, plane);
// throw exception if creation failed
if (null == sketchPlane)
{
throw new Exception("Create the sketch plane failed.");
}
return sketchPlane;
}
Parameters
| Parameter | Type | Description |
|---|---|---|
| document | Document | The document. |
| plane | Plane | The geometry plane where the sketch plane will be created. |
Return Value
| Type | Description |
|---|---|
| SketchPlane | The newly created sketch plane. |
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | Sketch plane creation is not allowed in this family. |
| ArgumentNullException | A non-optional argument was null |
| ModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. |
| ModificationOutsideTransactionException | The document has no open transaction. |