private bool CategoryCheck(CC_Category cat)
        {
            Category    famcat   = currentDoc.OwnerFamily.FamilyCategory;
            CC_Category ccfamcat = RevitCategories.getCC_Category(famcat);

            if (ccfamcat.Children.Contains(cat.Name) || cat.Parent == ccfamcat.Name)
            {
                return(true);
            }
            return(false);
        }
        public static void RunCategorySetup(Document currentDoc)
        {
            RevitCategories cats = new RevitCategories(currentDoc);

            if (!currentDoc.IsFamilyDocument)
            {
                CategoryMethod method = new CategoryMethod(cats.CategorySetup);
                int            i      = CategoryCalls.CategoryLoop(method);
                TaskDialog.Show("Categories Setup", "The line weights have been set for " + i + " Categories!");
            }
            else
            {
                CategoryMethod    method = new CategoryMethod(cats.CategorySetup);
                CategoryQualifier qual   = new CategoryQualifier(cats.CategoryCheck);
                int i = CategoryCalls.CategoryLoop(method, qual);
                TaskDialog.Show("Categories Setup", "The line weights have been set for " + i + " Categories!");
            }
        }