Ejemplo n.º 1
0
        /***************************************************/

        public static HostObjAttributes ToRevitElementType(this oM.Physical.Constructions.IConstruction construction, Document document, IEnumerable <BuiltInCategory> categories = null, RevitSettings settings = null, Dictionary <Guid, List <int> > refObjects = null)
        {
            if (construction == null || document == null)
            {
                return(null);
            }

            HostObjAttributes elementType = refObjects.GetValue <HostObjAttributes>(document, construction.BHoM_Guid);

            if (elementType != null)
            {
                return(elementType);
            }

            settings = settings.DefaultIfNull();

            elementType = construction.ElementType(document, categories, settings) as HostObjAttributes;
            if (elementType == null)
            {
                return(null);
            }

            // Copy parameters from BHoM object to Revit element
            elementType.CopyParameters(construction, settings);

            refObjects.AddOrReplace(construction, elementType);
            return(elementType);
        }
Ejemplo n.º 2
0
        /***************************************************/

        public static HostObjAttributes ElementType(this oM.Physical.Constructions.IConstruction construction, Document document, IEnumerable <BuiltInCategory> builtInCategories, RevitSettings settings = null)
        {
            return(construction.ElementType <HostObjAttributes>(document, builtInCategories));
        }