One of the somewhat obscure but interesting features that I had been looking forward to in the Revit 2013 API, I finally got a chance to use recently when updating our Scan To BIM for Revit application.
That is - you can finally look at the ViewRange settings for a particular plan view. Now, there are a thousand posts out there about how View Range works, and I think you can also ask a hundred Revit users and get at least 30 different answers. The truth is, there are a LOT of complications to it.
From the API persective, there are 5 kinds of PlaneViewPlanes:
- Top Clip Plane
- Cut Plane
- Bottom Clip Plane
- View Depth Plane
- Underlay Bottom Plane
PlanViewRange range = myPlanView.GetViewRange();// for a given plane, find the associated level and offsetElementId cutLevelId = range.GetLevelId( PlanViewPlane.CutPlane );double cutLevelOffset = range.GetOffset( PlanViewPlane.CutPlane );
The Real Reason For My Post: View Direction
// determine the view directionElementId vftId = vp.GetTypeId();Element vft = vp.Document.GetElement(vftId);if (vft == null) throw new ArgumentException("Unable to find view family type for view: " + vp.Name);Parameter viewDirParam = vft.get_Parameter(BuiltInParameter.PLAN_VIEW_VIEW_DIR);