Exemplo n.º 1
0
        protected static object GetIdDbValue(Element element)
        {
            int elementId = APIObjectList.GetElementId(element);

            if (elementId == -1)
            {
                return(System.DBNull.Value);
            }
            return(elementId);
        }
        private object CreateListItem(FamilyInstance familyInstance, Phase phase)
        {
            SpatialElement spatialElement = this.GetSpatialElement(familyInstance, phase);

            if (spatialElement != null)
            {
                return(new object[]
                {
                    familyInstance.Id.IntegerValue,
                    phase.Id.IntegerValue,
                    spatialElement.Id.IntegerValue,
                    APIObjectList.GetElementId(familyInstance.DesignOption)
                });
            }
            return(null);
        }
Exemplo n.º 3
0
        private object CreateListItem(FamilyInstance familyInstance, Phase phase)
        {
            Room toRoom   = this.GetToRoom(familyInstance, phase);
            Room fromRoom = this.GetFromRoom(familyInstance, phase);

            if (toRoom != null || fromRoom != null)
            {
                return(new object[]
                {
                    familyInstance.Id.IntegerValue,
                    phase.Id.IntegerValue,
                    APIObjectList.GetElementId(familyInstance.DesignOption),
                    APIObjectList.GetElementId(fromRoom),
                    APIObjectList.GetElementId(toRoom)
                });
            }
            return(null);
        }
Exemplo n.º 4
0
 protected override SpatialElement GetSpatialElement(FamilyInstance familyInstance, Phase phase)
 {
     if (familyInstance == null)
     {
         return(null);
     }
     try
     {
         return(familyInstance.get_Space(phase));
     }
     catch (System.Exception value)
     {
         Log.WriteLine("FamilyInstance.get_Space Id:{0}", new object[]
         {
             APIObjectList.GetElementId(familyInstance)
         });
         Log.WriteLine(value);
     }
     return(null);
 }
Exemplo n.º 5
0
 private Room GetFromRoom(FamilyInstance familyInstance, Phase phase)
 {
     if (familyInstance == null)
     {
         return(null);
     }
     try
     {
         return(familyInstance.get_FromRoom(phase));
     }
     catch (System.Exception value)
     {
         Log.WriteLine("FamilyInstance.get_FromRoom Id:{0}", new object[]
         {
             APIObjectList.GetElementId(familyInstance)
         });
         Log.WriteLine(value);
     }
     return(null);
 }