Hi,
So setting the Field of View from the UI means cropping the region right?
use one of the following methods:
- select the perspective view, and drag the controls to change the field of view, also referred to as the crop region
- click Modify | Cameras tab
Crop panel
(Size Crop)
If you check the link I shared with you before, there is also another section which is called View Cropping which basically does this action.
The ViewCropRegionShapeManager.Valid property indicates whether the view is allowed to manage the crop region shape while the ShapeSet property indicates whether a shape has been set. The following example crops a view around the boundary of a room.
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.Curve);
}
ViewCropRegionShapeManager vcrShapeMgr = view.GetCropRegionShapeManager();
vcrShapeMgr.SetCropRegionShape(loop);
break; // if more than one set of boundary segments for room, crop around the first one
}
}
}
}
I haven't tried it myself but it seems like can point you out in the right direction.
Cheers,