public static bool IsValidElement(DB.Element element)
        {
            if (element is DB.ElementType)
            {
                return(false);
            }

            if (element is DB.View)
            {
                return(false);
            }

            if (element.Location is object)
            {
                return(true);
            }

            return
                (
                element is DB.DirectShape ||
                element is DB.CurveElement ||
                element is DB.CombinableElement ||
                element is DB.Architecture.TopographySurface ||
                element is DB.Opening ||
                (element.Category is object && element.CanHaveTypeAssigned())
                );
        }
예제 #2
0
        public static new bool IsValidElement(DB.Element element)
        {
            if (element.Category is null)
            {
                return(false);
            }

            return(element.CanHaveTypeAssigned());
        }
예제 #3
0
 public static bool IsValidElement(DB.Element element)
 {
     return
         (
         element is DB.DirectShape ||
         element is DB.CurveElement ||
         element is DB.CombinableElement ||
         element is DB.Architecture.TopographySurface ||
         (element.Category is object && element.CanHaveTypeAssigned())
         );
 }
예제 #4
0
        public static new bool IsValidElement(DB.Element element)
        {
            if (element is DB.ElementType)
            {
                return(false);
            }

            if (element is DB.View)
            {
                return(false);
            }

            return(element.Category is object && element.CanHaveTypeAssigned());
        }
예제 #5
0
 private void AddElementParams(Element e)
 {
     foreach (Parameter p in e.Parameters)
     {
         if (!(p.StorageType == StorageType.None))
         {
             AddDropDownItem(p);
         }
     }
     // if element can have type assigned it's safe to assume that it's an instance
     // and add type parameters to the list
     if (e.CanHaveTypeAssigned())
     {
         Autodesk.Revit.DB.ElementType et = DocumentManager.Instance.CurrentDBDocument.GetElement(e.GetTypeId()) as Autodesk.Revit.DB.ElementType;
         if (et != null)
         {
             AddTypeParams(et);
         }
     }
 }