IsValidShape Method (IList(GeometryObject), DirectShapeTargetViewType)


Direct Shape Is Valid Shape(IList Geometry Object , Direct Shape Target View Type) Method

Validates view-specific shape to be stored in a DirectShape. Expects a non-default view type.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public bool IsValidShape(
	IList<GeometryObject> shape,
	DirectShapeTargetViewType viewType
)

Parameters

shape IList GeometryObject
Shape of this object expressed as a collection of GeometryObjects. For viewType = DirectShapeTargetViewType::Default, the supported types of GeometryObjects are: Solid, Mesh, GeometryInstance, Point and Curve. For viewType = DirectShapeTargetViewType::Plan, the supported types of GeometryObjects are: Point and Curve.
viewType DirectShapeTargetViewType
The view type this shape is intended for.

Return Value

Boolean
True if the supplied shape passes the validation criteria.
Exceptions
Exception Condition
ArgumentNullException A non-optional argument was null
ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration
See Also
ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →