Example #1
0
        private void ComBox_ATTA_SelectedIndexChanged(object sender, EventArgs e)
        {
            TxtPipe.Text = "";
            ComboBox  comb      = sender as ComboBox;
            NameRef   nr        = (NameRef)comb.SelectedItem;
            DbElement dbElement = DbElement.GetElement(nr.Ref);
            DbElement Pipe      = dbElement.Owner.Owner;
            DrawList  dl        = DrawListManager.Instance.CurrentDrawList;

            TxtPipe.Text = Pipe.ToString();
            DbElement hanger = dbElement.GetElement(DbAttributeInstance.CREF);

            dl.Add(Pipe);
            dl.Add(hanger);
            //dl.AddToSelection();
            // DbElement Support = hanger.Owner.GetElement(DbAttributeInstance.STLR);
            ListBox_Element.Items.Clear();
            foreach (DbElement h in hanger.Members())
            {
                ListBox_Element.Items.Add(new NameRef(h.ToString(), h.RefNo()));
            }
            //foreach (DbElement s in Support.Owner.Members())
            //{
            //    ListBox_Element.Items.Add(new NameRef(s.ToString(), s.RefNo()));
            //}
            ListBox_Element.DisplayMember = "Name";
        }
Example #2
0
        private void ListBox_Element_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListBox   lb        = sender as ListBox;
            NameRef   nr        = (NameRef)lb.SelectedItem;
            DbElement dbElement = DbElement.GetElement(nr.Ref);

            CurrentElement.Element = dbElement;
        }
Example #3
0
        private void btn_CE_Click(object sender, EventArgs e)
        {
            DbElement           CE     = CurrentElement.Element;
            TypeFilter          filter = new TypeFilter(DbElementTypeInstance.ATTACHMENT);
            DBElementCollection coll   = new DBElementCollection(CE, filter);
            List <NameRef>      listNR = new List <NameRef>();

            foreach (DbElement de in coll)
            {
                NameRef nr = new NameRef(de.ToString(), de.RefNo());
                //nr.Name = de.ToString();
                //int[] rn = de.RefNo();
                //foreach (int r in rn)
                //{
                //    nr.Ref+=r.ToString()+"/";
                //}
                //nr.Ref.TrimEnd('/');
                listNR.Add(nr);
            }
            ComBox_ATTA.DataSource    = listNR;
            ComBox_ATTA.DisplayMember = "Name";
            //ComBox_ATTA.ValueMember = "Ref";
            BindHS();
        }