Message 1 of 8
how to change cielling plan's view range , offset and associated level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hey,
I have an active cielling plan, i would like to change it's view range.
to be more specific: i would like to change the Top associated level, and the view depth from unlimited to current level
and set new offset values:
by looking at my immediate window when debugging, it seems as though i can get the view range values, and set
new levelId to the view range ( integerValue: -1 == unlimited, integerValue:-3==current, etc...)
also setting new offset values are looking good in the immediate window, but the nothing changes in the model.
is it possible to change view range using the api? if so, can someone help me understand what is the problem and tell me what i'm doing wrong?
public void viewRange(Document doc)
{
//setting the view plan to be active view
ViewPlan viewPlan = doc.ActiveView as ViewPlan;
//setting plan- view planes to the top clip, cut plane,bottom plane and view depth
PlanViewPlane planView_topClip = PlanViewPlane.TopClipPlane;
PlanViewPlane planView_bottomClip = PlanViewPlane.BottomClipPlane;
PlanViewPlane planView_cutClip = PlanViewPlane.CutPlane;
PlanViewPlane planView_vDepth = PlanViewPlane.ViewDepthPlane;
//setting view range variable
PlanViewRange viewRange = viewPlan.GetViewRange();
//using transaction to execute changes in the model
using (Transaction transaction = new Transaction(doc, "transactionName"))
{
transaction.Start();
//setting offser changes to the view range
viewRange.SetOffset(planView_topClip, 666 * 0.03280839);
viewRange.SetOffset(planView_cutClip, 222 * 0.03280839);
viewRange.SetOffset(planView_bottomClip, 322 * 0.03280839);
viewRange.SetOffset(planView_vDepth, 222 * 0.03280839);
//getting elementId for the current,unlimited, level below and above
ElementId ele = PlanViewRange.Current;
ElementId ele_inf = PlanViewRange.Unlimited;
ElementId ele_lev_bel = PlanViewRange.LevelBelow;
ElementId ele_lev_abo = PlanViewRange.LevelAbove;
// set changes to the view range top , bottom and depth and associate them to the current level.
viewRange.SetLevelId(planView_topClip, ele);
viewRange.SetLevelId(PlanViewPlane.BottomClipPlane, ele);
viewRange.SetLevelId(PlanViewPlane.ViewDepthPlane, ele);
transaction.Commit();
}
}