StartWithNewSketch Method


Sketch Edit Scope Start With New Sketch Method

Starts a sketch edit mode for an element which, at this moment, doesn't have a sketch.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public void StartWithNewSketch(
	ElementId elementId
)

Parameters

elementId ElementId
The Element without sketch to be edited.
Exceptions
Exception Condition
ArgumentException The ElementId elementId already has a sketch defined. -or- Element does not support sketch editing. -or- Failed to start the sketch edit mode.
ArgumentNullException A non-optional argument was null
InvalidOperationException This SketchEditScope is not permitted to start at this moment for one of the following possible reasons: The document is in read-only state, or the document is currently modifiable, or there already is another edit mode active in the document. -or- Cannot create sketch.
Remarks
Some surface Revit elements (like some Walls or some Analytical Elements) does not have a valid sketch all the time so in order to edit them, we have to create a valid sketch first. The application will need to start a transaction to actually make changes to the element. SketchEditScope can only be started when there is no transaction active, thus it does not work for commands running in automatic transaction mode.
See Also