SetShape Method (IList(GeometryObject), DirectShapeTargetViewType)

Builds the shape of this object from the supplied collection of GeometryObjects. The objects are copied. If the new shape is identical to the old one, the old shape will be kept.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: (
Since: 2015


public void SetShape(
	IList<GeometryObject> pGeomArr,
	DirectShapeTargetViewType viewType
Visual Basic
Public Sub SetShape ( _
	pGeomArr As IList(Of GeometryObject), _
	viewType As DirectShapeTargetViewType _
Visual C++
void SetShape(
	IList<GeometryObject^>^ pGeomArr, 
	DirectShapeTargetViewType viewType


Type: System.Collections.Generic 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.
Type: Autodesk.Revit.DB DirectShapeTargetViewType
Optional: set a view-specific shape representation that will be used in views of that type only. Passing DirectShapeTargetViewType::Default as view type will cause the default shape to be set.


Exception Condition
Autodesk.Revit.Exceptions ArgumentException At least one member of pGeomArr does not satisfy DirectShape validation criteria.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration

See Also