public void TestPanelInsert() { Point3d p0, pf; if (Picker.Point("Selecciona el punto inicial", out p0) && Picker.Point("Selecciona el punto final", p0, out pf)) { App.Riviera.Is3DEnabled = true; new QuickTransactionWrapper((Document doc, Transaction tr) => { RivieraSize frente = new RivieraSize() { Measure = KEY_FRONT, Nominal = 18, Real = 18 * 0.0254d }, alto1 = new RivieraSize() { Measure = KEY_HEIGHT, Nominal = 27, Real = 27 * 0.0254d }, alto2 = new RivieraSize() { Measure = KEY_HEIGHT, Nominal = 15, Real = 15 * 0.0254d }; PanelMeasure panel = new PanelMeasure(frente, alto1), panel2 = new PanelMeasure(frente, alto2); BordeoPanelStack stack = new BordeoPanelStack(p0, pf, panel); stack.AddPanel(panel2); stack.Draw(tr); }).Run(); } }
/// <summary> /// Gets the heights. /// </summary> /// <param name="panelHeight">Height of the panel.</param> /// <param name="panelHeight27">The panel height27.</param> /// <param name="panelHeight15">The panel height15.</param> /// <returns>The Riviera Height sizes</returns> public static RivieraSize[] GetHeights(this BordeoPanelHeight panelHeight, RivieraSize panelHeight27, RivieraSize panelHeight15) { RivieraSize[] heights; switch (panelHeight) { case BordeoPanelHeight.NormalMini: heights = new RivieraSize[] { panelHeight27, panelHeight15 }; break; case BordeoPanelHeight.NormalMiniNormal: heights = new RivieraSize[] { panelHeight27, panelHeight15, panelHeight27 }; break; case BordeoPanelHeight.NormalThreeMini: heights = new RivieraSize[] { panelHeight27, panelHeight15, panelHeight15, panelHeight15 }; break; case BordeoPanelHeight.NormalTwoMinis: heights = new RivieraSize[] { panelHeight27, panelHeight15, panelHeight15 }; break; case BordeoPanelHeight.ThreeNormals: heights = new RivieraSize[] { panelHeight27, panelHeight27, panelHeight27 }; break; case BordeoPanelHeight.TwoNormalOneMini: heights = new RivieraSize[] { panelHeight27, panelHeight27, panelHeight15 }; break; case BordeoPanelHeight.TwoNormals: heights = new RivieraSize[] { panelHeight27, panelHeight27 }; break; default: heights = new RivieraSize[0]; break; } return heights; }
/// <summary> /// Initializes the sizes. /// </summary> private void InitSizes() { ElementSizeCollection panelRecto = new ElementSizeCollection("BR2010"); ElementSizeCollection panelL90 = new ElementSizeCollection("BR2020"); ElementSizeCollection panelL135 = new ElementSizeCollection("BR2030"); double[] frentes = new double[] { 18d, 24, 30, 36, 42, 48 }, heights = new double[] { 15, 27 }; RivieraSize frente, frenteFinal, alto; for (int i = 0; i < frentes.Length; i++) { for (int j = 0; j < heights.Length; j++) { frente = new RivieraSize() { Measure = "FRENTE", Nominal = frentes[i], Real = frentes[i] * 0.0254d }; alto = new RivieraSize() { Measure = "ALTO", Nominal = heights[j], Real = heights[j] * 0.0254d }; panelRecto.Sizes.Add(new PanelMeasure(frente, alto)); } } for (int i = 0; i < frentes.Length; i++) { for (int j = 0; j < frentes.Length; j++) { for (int k = 0; k < heights.Length; k++) { frente = new RivieraSize() { Measure = "FRENTE_INICIAL", Nominal = frentes[i], Real = frentes[i] * 0.0254d }; frenteFinal = new RivieraSize() { Measure = "FRENTE_FINAL", Nominal = frentes[j], Real = frentes[j] * 0.0254d }; alto = new RivieraSize() { Measure = "ALTO", Nominal = heights[k], Real = heights[k] * 0.0254d }; panelL90.Sizes.Add(new LPanelMeasure(frente, frenteFinal, alto)); panelL135.Sizes.Add(new LPanelMeasure(frente, frenteFinal, alto)); } } } this.Sizes.Add(panelRecto.Code, panelRecto); this.Sizes.Add(panelL90.Code, panelL90); this.Sizes.Add(panelL135.Code, panelL135); }
/// <summary> /// Inverts the front. /// </summary> /// <returns>A size with the inverted fronts</returns> public LPanelMeasure InvertFront() { RivieraSize s0 = new RivieraSize() { Measure = this.FrenteStart.Measure, Nominal = this.FrenteEnd.Nominal, Real = this.FrenteEnd.Real }, s1 = new RivieraSize() { Measure = this.FrenteEnd.Measure, Nominal = this.FrenteStart.Nominal, Real = this.FrenteStart.Real }; return(new LPanelMeasure(s0, s1, this.Alto)); }
/// <summary> /// Creats the meausure. /// </summary> /// <param name="result">The result.</param> /// <returns> /// Creates the measure /// </returns> protected override RivieraMeasure CreateMeausure(SelectionResult[] result) { RivieraSize frente = new RivieraSize() { Measure = KEY_FRONT, Nominal = result.ConvertValue <Double>(FIELD_FRENTE), Real = result.ConvertValue <Double>(FIELD_FRENTE_REAL) }, fondo = new RivieraSize() { Measure = KEY_HEIGHT, Nominal = result.ConvertValue <Double>(FIELD_FONDO), Real = result.ConvertValue <Double>(FIELD_FONDO_REAL) }; return(new PasoLuzMeasure(frente, fondo)); }
/// <summary> /// Handles the Loaded event of the UserControl control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void UserControl_Loaded(object sender, RoutedEventArgs e) { try { var db = GetDatabase(); this.Sizes = db.Sizes; var sizes = this.Sizes[CODE_PANEL_RECTO].Sizes.Select(x => x as PanelMeasure); var frentes = sizes.Select(x => new RivieraSizeItem() { Size = x.Frente, ItemName = x.Frente.Nominal.ToString() }); frentes = frentes.Distinct(); this.InitFrentes(this.cboStartFronts, frentes); this.InitFrentes(this.cboEndFronts, frentes); this.PanelHeight15 = sizes.FirstOrDefault(x => x.Alto.Nominal == 15d).Alto; this.PanelHeight27 = sizes.FirstOrDefault(x => x.Alto.Nominal == 27d).Alto; } catch (Exception exc) { App.Riviera.Log.AppendEntry(exc, null); } }
/// <summary> /// Creats the meausure. /// </summary> /// <param name="result">The result.</param> /// <returns> /// Creates the measure /// </returns> protected override RivieraMeasure CreateMeausure(SelectionResult[] result) { RivieraSize frente1 = new RivieraSize() { Measure = KEY_START_FRONT, Nominal = result.ConvertValue <Double>(FIELD_FRENTE_1), Real = result.ConvertValue <Double>(FIELD_FRENTE_1_REAL) }, frente2 = new RivieraSize() { Measure = KEY_END_FRONT, Nominal = result.ConvertValue <Double>(FIELD_FRENTE_2), Real = result.ConvertValue <Double>(FIELD_FRENTE_2_REAL) }, alto = new RivieraSize() { Measure = KEY_HEIGHT, Nominal = result.ConvertValue <Double>(FIELD_ALTO), Real = result.ConvertValue <Double>(FIELD_ALTO_REAL) }; return(new LPanelMeasure(frente1, frente2, alto)); }
/// <summary> /// Initializes a new instance of the <see cref="PasoLuzMeasure"/> class. /// </summary> /// <param name="frente">The panel "frente" size.</param> /// <param name="fondo">The panel "fondo" size.</param> public PasoLuzMeasure(RivieraSize frente, RivieraSize fondo) : base(frente, fondo) { }
/// <summary> /// Initializes a new instance of the <see cref="PuenteMeasure"/> class. /// </summary> /// <param name="frente">The panel "frente" size.</param> /// <param name="fondo">The panel "fondo" size.</param> /// <param name="fondo">The panel "alto" size.</param> public PuenteMeasure(RivieraSize frente, RivieraSize fondo, RivieraSize alto) : base(frente, fondo, alto) { }
/// <summary> /// Initializes a new instance of the <see cref="PanelMeasure"/> class. /// </summary> /// <param name="frente">The panel "frente" size.</param> /// <param name="alto">The panel "alto" size.</param> public PanelMeasure(RivieraSize frente, RivieraSize alto) : base(frente, alto) { }
/// <summary> /// Initializes a new instance of the <see cref="LPanelMeasure"/> class. /// </summary> /// <param name="frenteStart">The panel "frente inicial" size.</param> /// <param name="frenteEnd">The panel "frente final" size.</param> /// <param name="alto">The panel "alto" size.</param> public LPanelMeasure(RivieraSize frenteStart, RivieraSize frenteEnd, RivieraSize alto) : base(frenteStart, frenteEnd, alto) { }