Esempio n. 1
0
        void TestLoopCircuit(StartElementData data, Action <List <Element> > totalElments = null)
        {
            ClearErrorListView();

            MtTravelsalTree tree = new MtTravelsalTree(m_uIDocument.Document, data.System);
            List <Element>  eles = tree.TestCircuit(data.StartElement, m_isSameSystem, m_multiSystem, IsIsolatedElements, totalElments);

            if (eles != null && eles.Count != 0)
            {
                foreach (var ele in eles)
                {
                    AddListViewErrorData(ele, MtCommon.GetStringValue(ErrorType.Circuit));
                }
            }
            IList <PipeRelationError> pipeRelationErrors = m_dicPipeRelationError.Select(v => v.Value).ToList();

            pipeRelationErrors = pipeRelationErrors.OrderBy(v => (v.FamilyName + v.TypeName)).ToList();
            SetErrorListView(pipeRelationErrors);
        }
Esempio n. 2
0
 public void GetElementSystem()
 {
     m_startElements.Clear();
     if (m_uIDocument != null)
     {
         Selection selection = m_uIDocument.Selection;
         ICollection <ElementId> selectionIds = selection.GetElementIds();
         foreach (var eleId in selectionIds)
         {
             var startEle          = m_uIDocument.Document.GetElement(eleId);
             StartElementData data = new StartElementData()
             {
                 StartElement = startEle,
                 System       = ExtractMechanicalOrPipingSystem(startEle)
             };
             m_startElements.Add(data);
         }
     }
 }
Esempio n. 3
0
 public void OnTraversalTree(StartElementData data, bool isSaveIntoDB = true)
 {
     try {
         MtTravelsalTree tree = new MtTravelsalTree(m_uIDocument.Document, data.System);
         tree.TraversePipe(data.StartElement, m_isSameSystem, m_multiSystem);
         if (isSaveIntoDB)
         {
             string colName = string.Join(",", new string[] { m_systemName, m_subsystemName, m_tunnelName, m_tableName, m_columnName });
             tree.SaveIntoDB(m_dbfilepath, colName, m_isPositiveDir, m_isWaterReturnPipe);
             if (tree.IsHide)
             {
                 Document doc = m_uIDocument.Document;
                 tree.HideTraverseElement(doc);
             }
         }
         else
         {
             Document doc = m_uIDocument.Document;
             tree.HideTraverseElement(doc);
         }
     } catch (Exception) {
         TaskDialog.Show("Error", "不明所以!");
     }
 }