public void RemoveMarkPainting()
        {
            AttributeRefDetail atrMarkPaintInfo = AttrDet.Find(a => string.Equals(a.Tag, Settings.Default.AttributePanelSbPaint,
                                                                                  StringComparison.CurrentCultureIgnoreCase));

            if (atrMarkPaintInfo != null)
            {
                var atrRef = atrMarkPaintInfo.IdAtrRef.GetObject(OpenMode.ForWrite, false, true) as AttributeReference;
                atrRef.TextString = "";
            }
        }
 public static bool IsMountingPanel(BlockReference blRefPanelSB,
                                    out string mark, out string paint, out List <AttributeRefDetail> attrsDet, PanelLibraryLoadService libLoadServ = null)
 {
     mark     = null;
     paint    = null;
     attrsDet = null;
     if (!blRefPanelSB.IsDynamicBlock && blRefPanelSB.AttributeCollection != null)
     {
         attrsDet = new List <AttributeRefDetail>();
         foreach (ObjectId idAtrRef in blRefPanelSB.AttributeCollection)
         {
             var atrRef = idAtrRef.GetObject(OpenMode.ForRead, false, true) as AttributeReference;
             // ПОКРАСКА
             if (string.Equals(atrRef.Tag, Settings.Default.AttributePanelSbPaint, StringComparison.CurrentCultureIgnoreCase))
             {
                 var atrDet = new AttributeRefDetail(atrRef);
                 attrsDet.Add(atrDet);
                 paint = atrRef.TextString.Trim();
                 // Если выполняется создание альбома и выключена опция проверки покраски, то стираем марку покраски из монтажной панели
                 if (libLoadServ?.Album != null && !libLoadServ.Album.StartOptions.CheckMarkPainting)
                 {
                     // Удаление старой марки покраски из блока монтажной панели
                     atrRef.UpgradeOpen();
                     atrRef.TextString = string.Empty;
                 }
             }
             // МАРКА
             else if (string.Equals(atrRef.Tag, Settings.Default.AttributePanelSbMark, StringComparison.CurrentCultureIgnoreCase))
             {
                 var atrDet = new AttributeRefDetail(atrRef);
                 attrsDet.Add(atrDet);
                 mark = atrRef.TextString.Trim();
             }
         }
         return(attrsDet.Count == 2);
     }
     return(false);
 }
Exemple #3
0
 private void defineAttr(BlockReference blRef)
 {
     if (blRef.AttributeCollection != null)
      {
     foreach (ObjectId idAtrRef in blRef.AttributeCollection)
     {
        using (var atrRef = idAtrRef.Open(OpenMode.ForRead, false, true) as AttributeReference)
        {
           if (string.Equals(atrRef.Tag, Settings.Default.AttributeFacadeAxis1))
           {
              AttrAxis1 = new AttributeRefDetail(atrRef);
              Axis1 = atrRef.TextString.Trim();
           }
           else if (string.Equals(atrRef.Tag, Settings.Default.AttributeFacadeAxis2))
           {
              AttrAxis2 = new AttributeRefDetail(atrRef);
              Axis2 = atrRef.TextString.Trim();
           }
        }
     }
      }
 }