Esempio n. 1
0
        public PipeRelationError CreatePipeRelationError(string id, string familyName, string typeName, string errorMsg)
        {
            PipeRelationError error = new PipeRelationError();

            error.ID         = id;
            error.FamilyName = familyName;
            error.TypeName   = typeName;
            error.ErrorMsg   = errorMsg;
            return(error);
        }
Esempio n. 2
0
        void AddListViewErrorData(Element ele, string errorType = null)
        {
            string            eleId      = ele.Id.ToString();
            string            famliyName = MtCommon.GetElementFamilyName(m_uIDocument.Document, ele);
            string            typeName   = MtCommon.GetElementType(m_uIDocument.Document, ele);
            string            message    = errorType;
            PipeRelationError error      = CreatePipeRelationError(ele.Id.ToString(), famliyName, typeName, message);

            if (!m_dicPipeRelationError.ContainsKey(ele.Id.ToString()))
            {
                m_dicPipeRelationError.Add(eleId, error);
            }
        }
        private void PipeRelationView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.Source is System.Windows.Controls.ListView)
            {
                PipeRelationError error = PipeRelationView.SelectedItem as PipeRelationError;

                if (error != null && error is PipeRelationError)
                {
                    string  id      = error.ID;
                    Element element = MtCommon.GetElementById(m_uidoc.Document, id);
                    MtCommon.ElementCenterDisplay(m_uidoc, element);

                    IList <ElementId> list = new List <ElementId>();
                    list.Add(element.Id);
                    m_uidoc.Selection.SetElementIds(list);
                }
            }
        }