Пример #1
0
        public static bool ParamIsExists(Document famDoc, SharedParameterContainer paramContainer)
        {
            FamilyManager fMan = famDoc.FamilyManager;

            foreach (FamilyParameter fparam in fMan.Parameters)
            {
                if (!fparam.IsShared)
                {
                    continue;
                }
                Guid guid1 = fparam.GUID;
                Guid guid2 = paramContainer.guid;
                bool check = guid1.Equals(guid2);
                if (check)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #2
0
        public ParametersInFamily(Document familyDoc)
        {
            FamilyManager fMan = familyDoc.FamilyManager;

            foreach (FamilyParameter fParam in fMan.Parameters)
            {
                if (!fParam.IsShared)
                {
                    continue;
                }

                string                name       = fParam.Definition.Name;
                bool                  isInstance = fParam.IsInstance;
                InternalDefinition    def        = fParam.Definition as InternalDefinition;
                Guid                  guid       = fParam.GUID;
                BuiltInParameterGroup paramGroup = fParam.Definition.ParameterGroup;

                SharedParameterContainer paramContainer = new SharedParameterContainer(name, guid, paramGroup, isInstance, def);

                parameters.Add(paramContainer);
            }
        }