Reputation: 11
my idea
I tried to use "SetViewRange" to get "View Range" in "Plan Region", but "Plan Region" is not "View Plane", only "ViewPlane" can use "SetViewRange" method, so this idea failed.
There is a parameter named "View Range" in the "Parameter" of the "Plane Region", and the "offset value" I want is not found in the parameter "View Range",so this idea failed.
Upvotes: 1
Views: 873
Reputation: 1
the above view needs to be cast as ViewPlan:
ViewPlan view = uidoc.ActiveView as ViewPlan;
Upvotes: 0
Reputation: 588
You need to use the GetViewRange
method of your plan View
, in conjuctnion with the PlanViewPlane
object:
https://www.revitapidocs.com/2019/80d20187-97ea-f6c0-a3a8-d5545e0b3863.htm
So to get the Offsets looks something like this:
view = uidoc.ActiveView # the plan youre wanting to investigate
topOffset = view.GetViewRange().GetOffset(PlanViewPlane.TopClipPlane) # Top Offset
cutOffset = view.GetViewRange().GetOffset(PlanViewPlane.CutPlane) # Cut plane Offset
bottomOffset = view.GetViewRange().GetOffset(PlanViewPlane.BottomClipPlane) # Bottom Offset
Upvotes: 0