//public static List<DF.AnyOf<HB.ConstructionSetAbridged, HB.ConstructionSet>> ToDragonfly(this List<ConstructionSetBase> constructionSets) //{ // var sets = new List<DF.AnyOf<HB.ConstructionSetAbridged, HB.ConstructionSet>>(); // foreach (var set in constructionSets) // { // switch (set) // { // case ConstructionSetAbridged unused: // sets.Add(set.ToDragonfly() as HB.ConstructionSetAbridged); // break; // default: // sets.Add(null); // break; // } // } // return sets; //} //public static List<string> ToDragonfly(this Tuple<int, string> boundaryConditionObj) //{ // var (adjacentCurveIndex, adjacentRoomName) = boundaryConditionObj; // return new List<string> // { // $"{adjacentRoomName}..Face{adjacentCurveIndex + 1}", // adjacentRoomName // }; //} public static RVT.XYZ GetLocationPoint(this RVT.SpatialElement se) { RVT.XYZ result; if (se.Category.Id.IntegerValue == RVT.BuiltInCategory.OST_Rooms.GetHashCode()) { if (!(se is Autodesk.Revit.DB.Architecture.Room room)) { return(null); } if (!(room.Location is RVT.LocationPoint loc)) { return(null); } result = loc.Point; } else { if (!(se is Autodesk.Revit.DB.Mechanical.Space space)) { return(null); } if (!(space.Location is RVT.LocationPoint loc)) { return(null); } result = loc.Point; } return(result); }
/// <summary> /// Creates a new CurtainSystem for ceiling with transaction. /// </summary> /// <param name="doc"></param> /// <param name="app"></param> /// <param name="room"></param> /// <param name="typeName"></param> /// <param name="tplName"></param> public static CurtainSystem CreateCurtainCeiling(this Document doc, App app, Room2 room, string typeName, string tplName) { if (doc is null) { throw new NullReferenceException(nameof(doc)); } if (room is null) { throw new NullReferenceException(nameof(room)); } if (app is null) { throw new NullReferenceException(nameof(app)); } if (tplName is null) { throw new NullReferenceException(nameof(tplName)); } var parm = new CurtainParm(room, typeName, tplName); return(doc.CreateCurtainCeiling(app, parm)); }
public SpatialElement(DB.SpatialElement element) : base(element) { }
public SpatialElement(DB.SpatialElement gridLine) : base(gridLine) { }
/// <summary> /// Creates CurtainSystem list for wall with transaction. /// </summary> /// <param name="doc"></param> /// <param name="app"></param> /// <param name="room"></param> /// <param name="typeName"></param> /// <param name="tplName"></param> public static List <CurtainSystem> CreateCurtainWallList(this Document doc, App app, Room2 room, string typeName, string tplName) { if (doc is null) { throw new NullReferenceException(nameof(doc)); } if (app is null) { throw new NullReferenceException(nameof(app)); } if (room is null) { throw new NullReferenceException(nameof(room)); } if (typeName is null) { throw new NullReferenceException(nameof(typeName)); } if (tplName is null) { throw new NullReferenceException(nameof(tplName)); } var walls = room.GetBoundaryWallList(doc); var view3D = doc.Get3DViewList().FirstOrDefault(); var results = new List <CurtainSystem>(); foreach (var wall in walls) { var parm = new CurtainParm(room, wall, typeName, tplName); results.Add(doc.CreateCurtainWall(app, parm, view3D)); } return(results); }