Ejemplo n.º 1
0
        public static IntegerId IntegerId(this Element element)
        {
            if (element == null)
            {
                return(null);
            }

            IntegerId integerId = Convert.ToSAM(element.Id);

            if (integerId == null)
            {
                return(null);
            }

            string fullName = FullName(element);

            if (!string.IsNullOrEmpty(fullName))
            {
                integerId.SetValue(RevitIdParameter.FullName, fullName);
            }

            Category category = element is Family ? ((Family)element).FamilyCategory : element.Category;

            if (category != null)
            {
                integerId.SetValue(RevitIdParameter.CategoryName, category.Name);
                integerId.SetValue(RevitIdParameter.CategoryId, category.Id.IntegerValue);
            }

            integerId.SetValue(RevitIdParameter.UniqueId, element.UniqueId);

            return(integerId);
        }
Ejemplo n.º 2
0
        public static IntegerId IntegerId(this Element element)
        {
            if (element == null)
            {
                return(null);
            }

            IntegerId result = Core.Revit.Query.IntegerId(element);

            if (result == null)
            {
                return(result);
            }

            ISAMGeometry sAMGeometry = Location(element);

            if (sAMGeometry != null)
            {
                result.SetValue(RevitIdParameter.Location, sAMGeometry);
            }

            return(result);
        }