Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Sows as Linear panel.
        /// </summary>
        /// <param name="doc">The active document.</param>
        /// <param name="tr">The active transaction.</param>
        protected override RivieraObject InitSowing(Document doc, Transaction tr, params RivieraMeasure[] sizes)
        {
            Point3d p0, pf;

            if (this.PickStartDirection(out p0, out pf))
            {
                //Se convierten los tamaños a tamaños de bordeo
                IEnumerable <PanelMeasure> pSizes = sizes.Select(x => x as PanelMeasure);
                //El panel inferios se usa como distancia base del arreglo de paneles.
                var first = sizes[0] as PanelMeasure;
                BordeoPanelStack stack = new BordeoPanelStack(p0, pf, first);
                //Se agregan los tamaños superiores
                for (int i = 1; i < sizes.Length; i++)
                {
                    stack.AddPanel(sizes[i] as PanelMeasure);
                }
                //Se dibuja el stack
                stack.Draw(tr);
                var db = App.Riviera.Database.Objects;
                if (db.FirstOrDefault(x => x.Handle.Value == stack.Handle.Value) == null)
                {
                    db.Add(stack);
                }
                return(stack);
            }
            else
            {
                return(null);
            }
        }