Can't use Workplane that is not a Level. Set the desired Level as current Workplane.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
public static FailureDefinitionId WorkplaneShouldBeLevel { get; }
