Exemplo n.º 1
0
 public WindowData(string styleCategory, List <FamilySymbol> types, WindowTrimData trim, string shutterCategory, string keyCategory)
 {
     StyleCategory   = styleCategory;
     Types           = types;
     Trim            = trim;
     ShutterCategory = shutterCategory;
     KeyCategory     = keyCategory;
 }
Exemplo n.º 2
0
        private WindowData GetWindowTypes()
        {
            // Collect existing types
            List <FamilySymbol> windowTypes  = _doc.CollectTypes <FamilySymbol>(BuiltInCategory.OST_Windows);
            List <ElementType>  genericTypes = _doc.CollectTypes <ElementType>(BuiltInCategory.OST_GenericModel);

            // Getting the categories from the indices
            string[] winStyleCat        = TerminusFieldSplit(countItParams.WinStyle_T);
            string[] winComboCat        = TerminusFieldSplit(countItParams.WinCombo_F);
            string[] winTrimTopCat      = TerminusFieldSplit(countItParams.WinTrimTop_T);
            string[] winTrimSideCat     = TerminusFieldSplit(countItParams.WinTrimSide_T);
            string[] winTrimBottomCat   = TerminusFieldSplit(countItParams.WinTrimBottom_T);
            string[] winTrimColorCat    = TerminusFieldSplit(countItParams.WinTrimColor_T);
            string[] winShutterColorCat = TerminusFieldSplit(countItParams.WinShutterColor_T);
            string[] winShutterCat      = TerminusFieldSplit(countItParams.WinShutter_T);
            string[] winKeyCat          = TerminusFieldSplit(countItParams.WinKey_T);

            // Getting and creating new window trim types
            string newTrimTypeName = $"Window Framing-{winTrimColorCat[0]}-{winShutterColorCat[0]}";

            ElementType trimType    = genericTypes.First(type => type.Name.Contains("Window Framing"));
            ElementType newTrimType = genericTypes.First(type => type.Name.Contains(newTrimTypeName));

            if (genericTypes.All(type => type.Name != newTrimTypeName) && winTrimColorCat[0] != null)
            {
                newTrimType = CreateTrimType(trimType, winTrimColorCat[0], winShutterColorCat[0]);
            }

            // Filter to window style types
            List <FamilySymbol> winStyleTypes = windowTypes.Where(type => type.Name.Contains(StringArrayToString(winStyleCat))).ToList();

            // ADD - Output the "WinCombo" data and merge with related function
            var trim   = new WindowTrimData(newTrimType, winTrimTopCat[0], winTrimSideCat[0], winTrimBottomCat[0]);
            var window = new WindowData(winStyleCat[0], winStyleTypes, trim, winShutterCat[0], winKeyCat[0]);

            return(window);
        }