Exemplo n.º 1
0
        public LevelError CreateBasicInfoError(string id, string familyName, string typeName, string errorMsg)
        {
            LevelError error = new LevelError();

            error.ID         = id;
            error.FamilyName = familyName;
            error.TypeName   = typeName;
            error.ErrorMsg   = errorMsg;
            return(error);
        }
Exemplo 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;
            LevelError error      = CreateBasicInfoError(ele.Id.ToString(), famliyName, typeName, message);

            if (!m_dicLevelErrors.ContainsKey(ele.Id.ToString()))
            {
                m_dicLevelErrors.Add(eleId, error);
            }
        }
        private void LevelListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.Source is System.Windows.Controls.ListView)
            {
                LevelError error = LevelListView.SelectedItem as LevelError;

                if (error != null && error is LevelError)
                {
                    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);
                }
            }
        }