RVTDocs.com
Namespace: Autodesk.Revit.DB

ViewCropRegionShapeManager

Class
Description:
A class that provides access to settings related to the crop assigned to a view or a reference callout.
Remarks:

This class manages all the settings that make up the model and annotation crop geometry for a given view or reference callout. You can obtain the settings for a view from GetCropRegionShapeManager(). Obtain the settings for a reference callout from GetCropRegionShapeManagerForReferenceCallout(Document, ElementId).

The model crop region crops model elements, detail elements (such as insulation and detail lines), section boxes, and scope boxes at the model crop boundary. Visible crop boundaries of other related views are also cropped at the model crop boundary. The model crop region can be set as a polygonal boundary, a rectangular boundary, or rectangular boundary with one or more splits applied either horizontally or vertically. If a split is applied to the rectangular crop each resulting rectangular region is identified by a region index and occupies a percentage of the original crop rectangle. The regions may possibly be moved relative to one another.

The annotation crop region fully crops annotation elements when it touches any portion of the annotation element, so that no partial annotations are drawn. Annotations (such as symbols, tags, keynotes, and dimensions) that reference hidden or cropped model elements do not display in the view, even if they are inside the annotation crop region. The annotation crop region is always rectangular and at minimum occupies the same area as the rectangular model crop (or the corresponding rectangular boundary around the non-rectangular model crop), but can be offset to be bigger than the model crop in order to display more annotations.

Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.ViewCropRegionShapeManager
Syntax
Examples
public void CropAroundRoom(Room room, View view)
{
    if (view != null)
    {
        IList<IList<Autodesk.Revit.DB.BoundarySegment>> segments = room.GetBoundarySegments(new SpatialElementBoundaryOptions());

        if (null != segments)  //the room may not be bound
        {
            foreach (IList<Autodesk.Revit.DB.BoundarySegment> segmentList in segments)
            {
                CurveLoop loop = new CurveLoop();
                foreach (Autodesk.Revit.DB.BoundarySegment boundarySegment in segmentList)
                {
                    loop.Append(boundarySegment.GetCurve());
                }

                ViewCropRegionShapeManager vcrShapeMgr = view.GetCropRegionShapeManager();
                vcrShapeMgr.SetCropShape(loop);
                break;  // if more than one set of boundary segments for room, crop around the first one
            }
        }
    }
}
ViewCropRegionShapeManager Class Members:
Name Description Inherited From
BottomAnnotationCropOffset The offset from the bottom of the view crop that determines the location of the annotation crop bottom boundary.
CanBeSplit Verifies that the crop of the associated view is permitted to have multiple regions.
CanHaveAnnotationCrop Verifies that the view is allowed to have an annotation crop.
CanHaveShape Verifies that the crop of the associated view is permitted to have a non-rectangular shape.
IsSplitHorizontally Whether or not the view's crop is split (and the split is horizontal).
IsSplitVertically Whether or not the view's crop is split (and the split is vertical).
IsValidObject Specifies whether the .NET object represents a valid Revit entity.
LeftAnnotationCropOffset The offset from the left of the view crop that determines the location of the annotation crop left boundary.
NumberOfSplitRegions The number of split crop regions (1 if the crop is not currently split).
RightAnnotationCropOffset The offset from the right of the view crop that determines the location of the annotation crop right boundary.
ShapeSet Whether or not the view crop has a non-rectangular shape set.
Split Whether or not the view crop is split.
TopAnnotationCropOffset The offset from the top of the view crop that determines the location of the annotation crop top boundary.
Name Description Inherited From
Dispose Releases all resources used by the ViewCropRegionShapeManager
Equals Determines whether the specified object is equal to the current object. (Inherited from Object ) Object
GetAnnotationCropShape Gets the annotation crop box assigned to the view.
GetCropShape Gets the crop boundaries that are curently active.
GetHashCode Serves as the default hash function. (Inherited from Object ) Object
GetSplitRegionMaximum Returns the proportional location of the maximum boundary of the specified split crop region.
GetSplitRegionMinimum Returns the proportional location of the minimum boundary of the specified split crop region.
GetSplitRegionOffset Returns the offset for the specified split crop region.
GetType Gets the Type of the current instance. (Inherited from Object ) Object
IsCropRegionShapeValid Verifies that boundary represents one closed curve loop without self-intersections, consisting of non-zero length straight lines in a plane parallel to the view plane.
RemoveCropRegionShape Removes any non-rectangular boundary of the view's crop.
RemoveSplit Removes any split applied to the view's crop.
RemoveSplitRegion Removes one region in split crop.
SetCropShape Sets the boundary of the view's crop to the specified shape.
SplitRegionHorizontally Splits horizontally one region in split crop.
SplitRegionVertically Splits vertically one region in split crop.
ToString Returns a string that represents the current object. (Inherited from Object ) Object