Exemple #1
0
        /***************************************************/

        public static Element Create(IBHoMObject bHoMObject, Document document, RevitSettings settings, Dictionary <Guid, List <int> > refObjects)
        {
            if (bHoMObject == null)
            {
                NullObjectCreateError(typeof(IBHoMObject));
                return(null);
            }

            try
            {
                Element element = bHoMObject.IToRevit(document, settings, refObjects);
                bHoMObject.SetIdentifiers(element);

                //Assign Tags
                string tagsParameterName = null;
                if (settings != null)
                {
                    tagsParameterName = settings.ParameterSettings?.TagsParameter;
                }

                if (!string.IsNullOrEmpty(tagsParameterName))
                {
                    element.SetTags(bHoMObject, tagsParameterName);
                }

                return(element);
            }
            catch (Exception ex)
            {
                ObjectNotCreatedError(bHoMObject, ex);
                return(null);
            }
        }