示例#1
0
        private void FillDataFromFamily()
        {
            Name       = Family.Name;
            CategoryId = Family.FamilyCategoryId.IntegerValue;

            var familySymbols = new List <ExtFamilySymbol>();

            foreach (var familySymbolId in Family.GetFamilySymbolIds())
            {
                if (Family.Document.GetElement(familySymbolId) is FamilySymbol familySymbol)
                {
                    var extFamilySymbol = new ExtFamilySymbol(this, familySymbol);
                    familySymbols.Add(extFamilySymbol);
                }
            }

            for (var i = 0; i < familySymbols.Count; i++)
            {
                var extFamilySymbol        = familySymbols[i];
                var replacingFamilySymbols = new List <ExtFamilySymbol>();
                for (var j = 0; j < familySymbols.Count; j++)
                {
                    if (i == j)
                    {
                        continue;
                    }
                    replacingFamilySymbols.Add(familySymbols[j]);
                }

                FamilySymbolPairs.Add(new ExtFamilySymbolsPair(extFamilySymbol, replacingFamilySymbols));
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtFamilySymbolsPair"/> class.
 /// </summary>
 /// <param name="familySymbolToReplace">Типоразмер для замены</param>
 /// <param name="replacingFamilySymbols">Заменяющие типоразмеры</param>
 public ExtFamilySymbolsPair(ExtFamilySymbol familySymbolToReplace, List <ExtFamilySymbol> replacingFamilySymbols)
 {
     FamilySymbolToReplace  = familySymbolToReplace;
     ReplacingFamilySymbols = replacingFamilySymbols;
 }