CreateDetail Method


View Section Create Detail Method

Returns a new detail ViewSection.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public static ViewSection CreateDetail(
	Document document,
	ElementId viewFamilyTypeId,
	BoundingBoxXYZ sectionBox
)

Parameters

document Document
The document to which the new detail ViewSection will be added.
viewFamilyTypeId ElementId
The id of the ViewFamilyType which will be used by the new detail ViewSection. The type needs to be a Detail ViewFamily.
sectionBox BoundingBoxXYZ
The BoundingBoxXYZ which specifies the new ViewSection's view direction and extents.

Return Value

ViewSection
The new detail ViewSection.
Exceptions
Exception Condition
ArgumentException The ViewFamilyType must be a Detail ViewFamily. -or- The BoundingBoxXYZ is not appropriate for detail views. The basis vectors of must be unit length and orthonormal. The near and far bound offsets cannot be reversed or too close to each other. MinEnabled and MaxEnabled must be set to true for all three directions. -or- Detail section view 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.
Remarks
Create a detail ViewSection whose view volume corresponds geometrically with the specified sectionBox. The view direction of the resulting section will be sectionBox.Transform.BasisZ and the up direction will be sectionBox.Transform.BasisY. The right hand direction will be computed so that (right, up, view direction) form a left handed coordinate system. The resulting view will be cropped, and far clipping will be active. The crop region will correspond to the projections of BoundingBoxXYZ.Min and BoundingBoxXYZ.Max onto the view's cut plane. The far clip distance will be equal to the difference of the z-coordinates of BoundingBoxXYZ.Min and BoundingBoxXYZ.Max. The new detail ViewSection will receive a unique view name.
See Also