在《C#开发BIMFACE系列21 服务端API之获取模型数据6:获取单模型的楼层信息》中介绍获取单个模型的所有楼层信息。某些场景下根据需要也可以一次性获取多个模型的楼层信息。
请求地址:GET https://api.bimface.com/data/v2/files/{fileIds}/fileIdfloorsMappings
说明:一次性查询多个模型的楼层信息
参数:
请求 path(示例):https://api.bimface.com/data/v2/files/1211223382064960,1211223382064961/fileIdfloorsMappings
多个模型之间,使用半角英文逗号分隔。
请求 header(示例):"Authorization: Bearer dc671840-bacc-4dc5-a134-97c1918d664b"
HTTP响应示例(200):
{ "code": "success", "message": null, "data": [ { "fileId": "1211223382064960", "floors": [ { "archElev": 0, "areas": null, "elevation": 0, "height": null, "id": "311", "miniMap": "m.bimface.com/b5dee8260e202863066714ace1633ad9/resource/model/maps/1F.png", "name": "1F", "rooms": null, "structElev": 0 }, { "archElev": 4200, "areas": null, "elevation": 4200, "height": null, "id": "694", "miniMap": "m.bimface.com/b5dee8260e202863066714ace1633ad9/resource/model/maps/2F.png", "name": "2F", "rooms": null, "structElev": 4200 }, { "archElev": -9900, "areas": null, "elevation": -9900, "height": null, "id": "268400", "miniMap": null, "name": "-2F", "rooms": null, "structElev": -9900 } ] }, { "fileId": "1570831055575328", "floors": [ { "archElev": 0, "areas": null, "elevation": 0, "height": null, "id": "13071", "miniMap": null, "name": "F1", "rooms": null, "structElev": 0 }, { "archElev": 3500, "areas": null, "elevation": 3500, "height": null, "id": "15913", "miniMap": null, "name": "F2", "rooms": null, "structElev": 3500 } ] } ] }
该返回结果的结构比较复杂,包含每个模型的ID,以及每个模型包含的所有楼层信息。封装成对应的 C# MultipleModelsFloors.cs 类 :
/// <summary> /// 获取多个模型的楼层信息 /// </summary> public class MultipleModelsFloors : GeneralResponse<List<MultipleModelsFloorsEntity>> { }
public class MultipleModelsFloorsEntity { [JsonProperty("fileId")] public string FileId { get; set; } [JsonProperty("floors")] public Floor[] Floors { get; set; } /// <summary>返回表示当前对象的字符串。</summary> /// <returns>表示当前对象的字符串。</returns> public override string ToString() { StringBuilder sb = new StringBuilder(); if (Floors != null && Floors.Length > 0) { foreach (var floor in Floors) { sb.AppendLine(floor.ToString()); } } return String.Format("[fileId={0}, floors={1}]", FileId, sb); } }
引用的 Floor 类,请参考《C#开发BIMFACE系列21 服务端API之获取模型数据6:获取单模型的楼层信息》。
C#实现方法:
1 /// <summary> 2 /// 获取多个模型的楼层信息 3 /// </summary> 4 /// <param name="accessToken">【必填】令牌</param> 5 /// <param name="fileIds">【必填】代表多个模型的文件ID</param> 6 /// <param name="includeArea">【非必填】是否将楼层中的面积分区ID、名称一起返回</param> 7 /// <param name="includeRoom">【非必填】是否将楼层中的房间ID、名称一起返回</param> 8 /// <returns></returns> 9 public virtual MultipleModelsFloors GetMultipleModelFloors(string accessToken, string[] fileIds, bool? includeArea = null, bool? includeRoom = null) 10 { 11 if (fileIds == null && fileIds.Length == 0) 12 { 13 throw new ArgumentException("参数 fileIds 不能为 null,且必须包含元素!"); 14 } 15 16 // GET https://api.bimface.com/data/v2/files/{fileIds}/fileIdfloorsMappings 17 string url = string.Format(BimfaceConstants.API_HOST + "/data/v2/files/{0}/fileIdfloorsMappings", fileIds.ToStringWith(",")); 18 if (includeArea != null && includeRoom == null) 19 { 20 url = url + "?includeArea=" + includeArea; 21 } 22 else if (includeArea == null && includeRoom != null) 23 { 24 url = url + "?includeRoom=" + includeRoom; 25 } 26 else if (includeArea != null && includeRoom != null) 27 { 28 url = url + "?includeArea=" + includeArea + "&includeRoom=" + includeRoom; 29 } 30 31 BimFaceHttpHeaders headers = new BimFaceHttpHeaders(); 32 headers.AddOAuth2Header(accessToken); 33 34 try 35 { 36 MultipleModelsFloors response; 37 38 HttpManager httpManager = new HttpManager(headers); 39 HttpResult httpResult = httpManager.Get(url); 40 if (httpResult.Status == HttpResult.STATUS_SUCCESS) 41 { 42 response = httpResult.Text.DeserializeJsonToObject<MultipleModelsFloors>(); 43 } 44 else 45 { 46 response = new MultipleModelsFloors 47 { 48 Message = httpResult.RefText 49 }; 50 } 51 52 return response; 53 } 54 catch (Exception ex) 55 { 56 throw new Exception("[获取多个模型的楼层信息]发生异常!", ex); 57 } 58 }
其中调用到的 httpManager.Get() 方法,请参考《C# HTTP系列》
在BIMFACE的控制台中可以看到我们上传的文件列表,模型状态均为转换成功。
以模型 “01_BIMFACE示例文件-Revit模型.rvt”、“GLD_结构B2.rvt” 为例测试上述的方法
success [fileId=1684795532158432, floors=[archElev=0, Areas=, elevation=0, height=, id=311, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/311.png, name=F1, rooms=, structElev=0] [archElev=3500, Areas=, elevation=3500, height=, id=694, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/694.png, name=F2, rooms=, structElev=3500] [archElev=7000, Areas=, elevation=7000, height=, id=259581, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/259581.png, name=F3, rooms=, structElev=7000] [archElev=10500, Areas=, elevation=10500, height=, id=259628, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/259628.png, name=ROOF, rooms=, structElev=10500] [archElev=-450, Areas=, elevation=-450, height=, id=259664, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/259664.png, name=地坪, rooms=, structElev=-450] ] [fileId=1689679293539776, floors=[archElev=0, Areas=, elevation=0, height=, id=311, miniMap=, name=0.000, rooms=, structElev=0] [archElev=-4600, Areas=, elevation=-4600, height=, id=694, miniMap=m.bimface.com/b0106219d6df6da77b6493a0565d9e0e/resource/model/maps/694.png, name=B1, rooms=, structElev=-4600] [archElev=-10000, Areas=, elevation=-10000, height=, id=274289, miniMap=m.bimface.com/b0106219d6df6da77b6493a0565d9e0e/resource/model/maps/274289.png, name=B2, rooms=, structElev=-10000] [archElev=-100, Areas=, elevation=-100, height=, id=274497, miniMap=, name=L1, rooms=, structElev=-100] [archElev=4100, Areas=, elevation=4100, height=, id=274619, miniMap=, name=L2, rooms=, structElev=4100] [archElev=7900, Areas=, elevation=7900, height=, id=274687, miniMap=, name=L3, rooms=, structElev=7900] [archElev=11700, Areas=, elevation=11700, height=, id=274788, miniMap=, name=L4, rooms=, structElev=11700] [archElev=15500, Areas=, elevation=15500, height=, id=274917, miniMap=, name=L5, rooms=, structElev=15500] [archElev=19300, Areas=, elevation=19300, height=, id=275072, miniMap=, name=L6, rooms=, structElev=19300] [archElev=23100, Areas=, elevation=23100, height=, id=275221, miniMap=, name=屋顶层, rooms=, structElev=23100] [archElev=27100, Areas=, elevation=27100, height=, id=275375, miniMap=, name=机房层, rooms=, structElev=27100] ]
如果选择【是否将楼层中的房间ID、名称一起返回】,则返回如下结果
success [fileId=1684795532158432, floors=[archElev=-450, Areas=, elevation=-450, height=450, id=259664, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/259664.png, name=地坪, rooms=, structElev=-450] [archElev=0, Areas=[boundary={"version":"2.0","loops":[[[{"z":0.0,"y":4312.7157614750367,"x":108.78299956026775},{"z":0.0,"y":6067.7157614750377,"x":108.7829995602706}],[{"z":0.0,"y":6067.7157614750367,"x":108.7829995602706},{"z":0.0,"y":6067.7157614750558,"x":-5571.2170004397294}],[{"z":0.0,"y":6067.7157614750558,"x":-5571.2170004397294},{"z":0.0,"y":1847.7157614750554,"x":-5571.2170004397367}],[{"z":0.0,"y":1847.7157614750554,"x":-5571.2170004397367},{"z":0.0,"y":1847.7157614750374,"x":108.78299956026481}],[{"z":0.0,"y":1847.7157614750374,"x":108.78299956026468},{"z":0.0,"y":4312.7157614750367,"x":108.78299956026864}]]]} , id=305074, levelId=, maxPt=[x=108.782995203586, y=6067.7155184672, z=0], minPt=[x=-5571.21677731631, y=1847.71568747529, z=0], name=餐厅 1] [boundary={"version":"2.0","loops":[[[{"z":0.0,"y":1157.715761475011,"x":8128.7829995602615},{"z":0.0,"y":1157.7157614750147,"x":7038.7829995602642}],[{"z":0.0,"y":1157.7157614750147,"x":7038.7829995602642},{"z":0.0,"y":4167.7157614750149,"x":7038.7829995602679}],[{"z":0.0,"y":4167.7157614750149,"x":7038.7829995602679},{"z":0.0,"y":4167.7157614750295,"x":2528.7829995602679}],[{"z":0.0,"y":4167.7157614750295,"x":2528.7829995602679},{"z":0.0,"y":1702.7157614750295,"x":2528.7829995602597}],[{"z":0.0,"y":1702.7157614750295,"x":2528.7829995602597},{"z":0.0,"y":-4274.2842385249705,"x":2528.782999560241}],[{"z":0.0,"y":-4274.2842385249705,"x":2528.782999560241},{"z":0.0,"y":-5404.2842385249705,"x":2528.7829995602369}],[{"z":0.0,"y":-5404.2842385249705,"x":2528.7829995602369},{"z":0.0,"y":-5404.284238524986,"x":7038.7829995602524}],[{"z":0.0,"y":-5404.284238524986,"x":7038.7829995602524},{"z":0.0,"y":-3984.2842385249846,"x":7038.7829995602542}],[{"z":0.0,"y":-3984.2842385249846,"x":7038.7829995602542},{"z":0.0,"y":-3984.2842385249887,"x":8128.7829995602533}],[{"z":0.0,"y":-3984.2842385249887,"x":8128.7829995602533},{"z":0.0,"y":1157.7157614750108,"x":8128.7829995602615}]]]} , id=305077, levelId=, maxPt=[x=8128.78267400807, y=4167.71559456087, z=0], minPt=[x=2528.78289828421, y=-5404.2840220871, z=0], name=客厅 2] [boundary={"version":"2.0","loops":[[[{"z":0.0,"y":-5104.2842385249442,"x":-5571.2170004397476},{"z":0.0,"y":-5104.284238524956,"x":-2261.2170004397494}],[{"z":0.0,"y":-5104.284238524956,"x":-2261.2170004397485},{"z":0.0,"y":-2678.2842385249555,"x":-2261.2170004397453}],[{"z":0.0,"y":-2678.2842385249555,"x":-2261.2170004397453},{"z":0.0,"y":-54.284238524955555,"x":-2261.2170004397408}],[{"z":0.0,"y":-54.28423852495537,"x":-2261.2170004397408},{"z":0.0,"y":-54.284238524944669,"x":-5571.2170004397394}],[{"z":0.0,"y":-54.284238524944669,"x":-5571.2170004397394},{"z":0.0,"y":-5104.2842385249442,"x":-5571.2170004397476}]]]} , id=305080, levelId=, maxPt=[x=-2261.21690987955, y=-54.2842363508981, z=0], minPt=[x=-5571.21677731632, y=-5104.28403410187, z=0], name=厨房 3] [boundary={"version":"2.0","loops":[[[{"z":0.0,"y":-5104.2842385249323,"x":-9181.2170004397485},{"z":0.0,"y":-5104.2842385249442,"x":-5861.2170004397467}],[{"z":0.0,"y":-5104.2842385249442,"x":-5861.2170004397467},{"z":0.0,"y":7.71576147505634,"x":-5861.2170004397385}],[{"z":0.0,"y":7.71576147505607,"x":-5861.2170004397385},{"z":0.0,"y":1557.7157614750565,"x":-5861.2170004397358}],[{"z":0.0,"y":1557.7157614750565,"x":-5861.2170004397358},{"z":0.0,"y":1557.715761475067,"x":-9181.2170004397376}],[{"z":0.0,"y":1557.715761475067,"x":-9181.2170004397376},{"z":0.0,"y":-5104.2842385249323,"x":-9181.2170004397485}]]]} , id=305086, levelId=, maxPt=[x=-5861.21676570201, y=1557.71569908962, z=0], minPt=[x=-9181.21663273829, y=-5104.28403410186, z=0], name=车库 5] [boundary={"version":"2.0","loops":[[[{"z":0.0,"y":69.7157614750437,"x":-1971.2170004397408},{"z":0.0,"y":-2616.2842385249569,"x":-1971.2170004397451}],[{"z":0.0,"y":-2616.2842385249569,"x":-1971.2170004397451},{"z":0.0,"y":-2616.284238524966,"x":728.78299956024591}],[{"z":0.0,"y":-2616.284238524966,"x":728.78299956024625},{"z":0.0,"y":-4274.2842385249651,"x":728.78299956024352}],[{"z":0.0,"y":-4274.2842385249651,"x":728.78299956024352},{"z":0.0,"y":-4274.28423852497,"x":2238.7829995602406}],[{"z":0.0,"y":-4274.28423852497,"x":2238.7829995602406},{"z":0.0,"y":1557.71576147503,"x":2238.7829995602597}],[{"z":0.0,"y":1557.7157614750304,"x":2238.7829995602597},{"z":0.0,"y":1557.7157614750367,"x":253.78299956026433}],[{"z":0.0,"y":1557.7157614750367,"x":253.78299956026433},{"z":0.0,"y":1557.7157614750554,"x":-5571.2170004397367}],[{"z":0.0,"y":1557.7157614750554,"x":-5571.2170004397367},{"z":0.0,"y":69.715761475055245,"x":-5571.2170004397394}],[{"z":0.0,"y":69.715761475055331,"x":-5571.2170004397394},{"z":0.0,"y":69.7157614750437,"x":-1971.217000439741}]]]} , id=309385, levelId=, maxPt=[x=2238.78290989853, y=1557.71569908961, z=0], minPt=[x=-5571.21677731631, y=-4274.28406734281, z=0], name=过厅 18] [boundary={"version":"2.0","loops":[[[{"z":0.0,"y":-2740.2842385249569,"x":-1971.2170004397451},{"z":0.0,"y":-3984.284238524956,"x":-1971.2170004397469}],[{"z":0.0,"y":-3984.284238524956,"x":-1971.2170004397469},{"z":0.0,"y":-3984.2842385249646,"x":604.78299956024352}],[{"z":0.0,"y":-3984.2842385249646,"x":604.782999560244},{"z":0.0,"y":-2740.2842385249655,"x":604.782999560246}],[{"z":0.0,"y":-2740.284238524966,"x":604.782999560246},{"z":0.0,"y":-2740.2842385249569,"x":-1971.2170004397451}]]]} , id=309448, levelId=, maxPt=[x=604.782975339101, y=-2740.28412877845, z=0], minPt=[x=-1971.21692149386, y=-3984.28407895711, z=0], name=仓库 19] [boundary={"version":"2.0","loops":[[[{"z":0.0,"y":4167.71576147503,"x":2238.7829995602679},{"z":0.0,"y":4167.7157614750367,"x":398.78299956026848}],[{"z":0.0,"y":4167.7157614750367,"x":398.78299956026837},{"z":0.0,"y":1847.7157614750361,"x":398.78299956026461}],[{"z":0.0,"y":1847.7157614750363,"x":398.78299956026467},{"z":0.0,"y":1847.7157614750306,"x":2238.7829995602606}],[{"z":0.0,"y":1847.7157614750306,"x":2238.7829995602606},{"z":0.0,"y":4167.71576147503,"x":2238.7829995602679}]]]} , id=309547, levelId=, maxPt=[x=2238.78290989854, y=4167.71559456087, z=0], minPt=[x=398.782983589279, y=1847.71568747528, z=0], name=卫生间 20] [boundary={"version":"2.0","loops":[[[{"z":0.0,"y":-4274.2842385249651,"x":666.78299956024114},{"z":0.0,"y":-4274.284238524956,"x":-1971.2170004397478}],[{"z":0.0,"y":-4274.284238524956,"x":-1971.2170004397474},{"z":0.0,"y":-6769.2842385249569,"x":-1971.2170004397515}],[{"z":0.0,"y":-6769.2842385249569,"x":-1971.2170004397515},{"z":0.0,"y":-6769.2842385249569,"x":-2116.2170004397517}],[{"z":0.0,"y":-6769.2842385249569,"x":-2116.2170004397517},{"z":0.0,"y":-7789.2842385249505,"x":-2116.2170004397535}],[{"z":0.0,"y":-7789.2842385249505,"x":-2116.2170004397535},{"z":0.0,"y":-7789.2842385249523,"x":-1371.2170004397533}],[{"z":0.0,"y":-7789.2842385249523,"x":-1371.2170004397533},{"z":0.0,"y":-7789.2842385249623,"x":1638.7829995602522}],[{"z":0.0,"y":-7789.2842385249623,"x":1638.7829995602522},{"z":0.0,"y":-7789.2842385249642,"x":2383.7829995602478}],[{"z":0.0,"y":-7789.2842385249642,"x":2383.7829995602483},{"z":0.0,"y":-6839.284238524976,"x":2383.7829995602497}],[{"z":0.0,"y":-6839.284238524976,"x":2383.7829995602497},{"z":0.0,"y":-6839.284238524976,"x":2238.7829995602342}],[{"z":0.0,"y":-6839.284238524976,"x":2238.7829995602342},{"z":0.0,"y":-5549.28423852497,"x":2238.7829995602365}],[{"z":0.0,"y":-5549.28423852497,"x":2238.7829995602365},{"z":0.0,"y":-4274.28423852497,"x":2238.7829995602406}],[{"z":0.0,"y":-4274.28423852497,"x":2238.7829995602406},{"z":0.0,"y":-4274.2842385249651,"x":666.78299956024352}]]]} , id=380345, levelId=, maxPt=[x=2383.78290409137, y=-4274.2840673428, z=0], minPt=[x=-2116.21691568671, y=-7789.28392656946, z=0], name=门厅 24] , elevation=0, height=3500, id=311, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/311.png, name=F1, rooms=, structElev=0] [archElev=3500, Areas=[boundary={"version":"2.0","loops":[[[{"z":3499.9999999999995,"y":6067.7157614750558,"x":-5571.2170004397294},{"z":3499.9999999999995,"y":1847.7157614750554,"x":-5571.2170004397367}],[{"z":3499.9999999999995,"y":1847.7157614750554,"x":-5571.2170004397367},{"z":3499.9999999999995,"y":1847.7157614750374,"x":108.78299956026373}],[{"z":3499.9999999999995,"y":1847.7157614750374,"x":108.78299956026378},{"z":3499.9999999999995,"y":4312.7157614750358,"x":108.78299956026775}],[{"z":3499.9999999999995,"y":4312.7157614750367,"x":108.78299956026775},{"z":3499.9999999999995,"y":4457.7157614750367,"x":108.782999560268}],[{"z":3499.9999999999995,"y":4457.7157614750367,"x":108.782999560268},{"z":3499.9999999999995,"y":6067.7157614750377,"x":108.7829995602706}],[{"z":3499.9999999999995,"y":6067.7157614750367,"x":108.7829995602706},{"z":3499.9999999999995,"y":6067.7157614750558,"x":-5571.2170004397294}]]]} , id=306373, levelId=, maxPt=[x=108.782995203586, y=6067.7155184672, z=3499.9998598274], minPt=[x=-5571.21677731631, y=1847.71568747529, z=3499.9998598274], name=次卧 8] [boundary={"version":"2.0","loops":[[[{"z":3499.9999999999995,"y":-6839.2842385249623,"x":-2116.2170004397522},{"z":3499.9999999999995,"y":-7644.2842385249514,"x":-2116.2170004397531}],[{"z":3499.9999999999995,"y":-7644.2842385249514,"x":-2116.2170004397531},{"z":3499.9999999999995,"y":-7644.2842385249542,"x":-1371.2170004397528}],[{"z":3499.9999999999995,"y":-7644.2842385249542,"x":-1371.2170004397528},{"z":3499.9999999999995,"y":-7644.2842385249642,"x":1638.7829995602526}],[{"z":3499.9999999999995,"y":-7644.2842385249642,"x":1638.7829995602526},{"z":3499.9999999999995,"y":-7644.284238524966,"x":2383.7829995602483}],[{"z":3499.9999999999995,"y":-7644.284238524966,"x":2383.7829995602483},{"z":3499.9999999999995,"y":-6839.2842385250142,"x":2383.7829995602497}],[{"z":3499.9999999999995,"y":-6839.284238524976,"x":2383.7829995602497},{"z":3499.9999999999995,"y":-6839.2842385249733,"x":1638.78299956025}],[{"z":3499.9999999999995,"y":-6839.2842385249733,"x":1638.78299956025},{"z":3499.9999999999995,"y":-6549.2842385249742,"x":1638.782999560251}],[{"z":3499.9999999999995,"y":-6549.2842385249742,"x":1638.782999560251},{"z":3499.9999999999995,"y":-6549.2842385249769,"x":2238.7829995602533}],[{"z":3499.9999999999995,"y":-6549.2842385249769,"x":2238.7829995602533},{"z":3499.9999999999995,"y":-5549.28423852497,"x":2238.7829995602547}],[{"z":3499.9999999999995,"y":-5549.28423852497,"x":2238.7829995602547},{"z":3499.9999999999995,"y":-4274.28423852497,"x":2238.7829995602569}],[{"z":3499.9999999999995,"y":-4274.28423852497,"x":2238.7829995602569},{"z":3499.9999999999995,"y":-4274.284238524956,"x":-1971.2170004397469}],[{"z":3499.9999999999995,"y":-4274.284238524956,"x":-1971.2170004397474},{"z":3499.9999999999995,"y":-5249.284238524956,"x":-1971.217000439749}],[{"z":3499.9999999999995,"y":-5249.284238524956,"x":-1971.217000439749},{"z":3499.9999999999995,"y":-6549.2842385249633,"x":-1971.2170004397512}],[{"z":3499.9999999999995,"y":-6549.2842385249633,"x":-1971.2170004397512},{"z":3499.9999999999995,"y":-6549.284238524966,"x":-1371.2170004397512}],[{"z":3499.9999999999995,"y":-6549.284238524966,"x":-1371.2170004397512},{"z":3499.9999999999995,"y":-6839.2842385249651,"x":-1371.2170004397524}],[{"z":3499.9999999999995,"y":-6839.2842385249651,"x":-1371.2170004397524},{"z":3499.9999999999995,"y":-6839.2842385249623,"x":-2116.2170004397522}]]]} , id=306376, levelId=, maxPt=[x=2383.78290409137, y=-4274.2840673428, z=3499.9998598274], minPt=[x=-2116.21691568671, y=-7644.28393237662, z=3499.9998598274], name=健身房 9] [boundary={"version":"2.0","loops":[[[{"z":3499.9999999999995,"y":4167.7157614750313,"x":2238.78299956027},{"z":3499.9999999999995,"y":4167.7157614750367,"x":398.7829995602674}],[{"z":3499.9999999999995,"y":4167.7157614750367,"x":398.78299956026757},{"z":3499.9999999999995,"y":1847.7157614750361,"x":398.7829995602637}],[{"z":3499.9999999999995,"y":1847.7157614750363,"x":398.7829995602637},{"z":3499.9999999999995,"y":1847.7157614750306,"x":2238.7829995602669}],[{"z":3499.9999999999995,"y":1847.7157614750306,"x":2238.7829995602669},{"z":3499.9999999999995,"y":4167.7157614750313,"x":2238.78299956027}]]]} , id=306379, levelId=, maxPt=[x=2238.78290989854, y=4167.71559456087, z=3499.9998598274], minPt=[x=398.782983589278, y=1847.71568747528, z=3499.9998598274], name=卫生间 10] [boundary={"version":"2.0","loops":[[[{"z":3499.9999999999995,"y":4167.7157614750149,"x":7038.7829995602679},{"z":3499.9999999999995,"y":4167.71576147503,"x":2528.7829995602706}],[{"z":3499.9999999999995,"y":4167.71576147503,"x":2528.7829995602706},{"z":3499.9999999999995,"y":1702.71576147503,"x":2528.7829995602665}],[{"z":3499.9999999999995,"y":1702.71576147503,"x":2528.7829995602665},{"z":3499.9999999999995,"y":-3984.28423852497,"x":2528.7829995602574}],[{"z":3499.9999999999995,"y":-3984.28423852497,"x":2528.7829995602574},{"z":3499.9999999999995,"y":-3984.2842385249869,"x":7183.7829995602533}],[{"z":3499.9999999999995,"y":-3984.2842385249869,"x":7183.7829995602533},{"z":3499.9999999999995,"y":-3984.28423852499,"x":8128.7829995602533}],[{"z":3499.9999999999995,"y":-3984.28423852499,"x":8128.7829995602533},{"z":3499.9999999999995,"y":1157.7157614750104,"x":8128.7829995602615}],[{"z":3499.9999999999995,"y":1157.715761475011,"x":8128.7829995602615},{"z":3499.9999999999995,"y":1157.7157614750147,"x":7038.7829995602624}],[{"z":3499.9999999999995,"y":1157.7157614750147,"x":7038.7829995602624},{"z":3499.9999999999995,"y":4167.7157614750149,"x":7038.7829995602679}]]]} , id=306386, levelId=, maxPt=[x=8128.78267400807, y=4167.71559456087, z=3499.9998598274], minPt=[x=2528.78289828423, y=-3984.28407895714, z=3499.9998598274], name=活动室 11] [boundary={"version":"2.0","loops":[[[{"z":3499.9999999999995,"y":1557.715761475067,"x":-9181.2170004397376},{"z":3499.9999999999995,"y":-3977.2842385249332,"x":-9181.2170004397449}],[{"z":3499.9999999999995,"y":-3977.2842385249337,"x":-9181.2170004397449},{"z":3499.9999999999995,"y":-3977.2842385249451,"x":-5778.2170004397476}],[{"z":3499.9999999999995,"y":-3977.2842385249451,"x":-5778.2170004397476},{"z":3499.9999999999995,"y":337.715761475056,"x":-5778.21700043974}],[{"z":3499.9999999999995,"y":337.71576147505613,"x":-5778.21700043974},{"z":3499.9999999999995,"y":1557.7157614750561,"x":-5778.2170004397385}],[{"z":3499.9999999999995,"y":1557.7157614750561,"x":-5778.2170004397385},{"z":3499.9999999999995,"y":1557.715761475067,"x":-9181.2170004397376}]]]} , id=309558, levelId=, maxPt=[x=-5778.2167690261, y=1557.71569908962, z=3499.9998598274], minPt=[x=-9181.21663273829, y=-3977.28407923744, z=3499.9998598274], name=次卧 21] [boundary={"version":"2.0","loops":[[[{"z":3499.9999999999995,"y":275.71576147504487,"x":-2261.2170004397403},{"z":3499.9999999999995,"y":275.71576147505584,"x":-5654.21700043974}],[{"z":3499.9999999999995,"y":275.71576147505584,"x":-5654.21700043974},{"z":3499.9999999999995,"y":-3977.2842385249451,"x":-5654.2170004397476}],[{"z":3499.9999999999995,"y":-3977.2842385249451,"x":-5654.2170004397476},{"z":3499.9999999999995,"y":-3977.284238524956,"x":-2261.2170004397476}],[{"z":3499.9999999999995,"y":-3977.284238524956,"x":-2261.2170004397472},{"z":3499.9999999999995,"y":275.7157614750447,"x":-2261.2170004397403}]]]} , id=309561, levelId=, maxPt=[x=-2261.21690987955, y=275.715750432828, z=3499.9998598274], minPt=[x=-5654.21677399223, y=-3977.28407923745, z=3499.9998598274], name=次卧 22] [boundary={"version":"2.0","loops":[[[{"z":3499.9999999999995,"y":-3984.2842385249696,"x":2238.7829995602574},{"z":3499.9999999999995,"y":1557.7157614750304,"x":2238.782999560266}],[{"z":3499.9999999999995,"y":1557.7157614750304,"x":2238.782999560266},{"z":3499.9999999999995,"y":1557.7157614750367,"x":253.78299956026325}],[{"z":3499.9999999999995,"y":1557.7157614750367,"x":253.78299956026325},{"z":3499.9999999999995,"y":1557.7157614750556,"x":-5654.2170004397385}],[{"z":3499.9999999999995,"y":1557.7157614750556,"x":-5654.2170004397385},{"z":3499.9999999999995,"y":399.71576147505573,"x":-5654.21700043974}],[{"z":3499.9999999999995,"y":399.71576147505584,"x":-5654.21700043974},{"z":3499.9999999999995,"y":399.71576147504391,"x":-1971.2170004397403}],[{"z":3499.9999999999995,"y":399.71576147504391,"x":-1971.2170004397403},{"z":3499.9999999999995,"y":-3984.284238524956,"x":-1971.2170004397472}],[{"z":3499.9999999999995,"y":-3984.284238524956,"x":-1971.2170004397472},{"z":3499.9999999999995,"y":-3984.2842385249696,"x":2238.7829995602569}]]]} , id=309564, levelId=, maxPt=[x=2238.78290989854, y=1557.71569908961, z=3499.9998598274], minPt=[x=-5654.21677399222, y=-3984.28407895711, z=3499.9998598274], name=过厅 23] , elevation=3500, height=3500, id=694, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/694.png, name=F2, rooms=, structElev=3500] [archElev=7000, Areas=[boundary={"version":"2.0","loops":[[[{"z":7000.0000000000009,"y":6067.7157614750558,"x":-5571.2170004397294},{"z":7000.0000000000009,"y":1847.7157614750554,"x":-5571.2170004397367}],[{"z":7000.0000000000009,"y":1847.7157614750554,"x":-5571.2170004397367},{"z":7000.0000000000009,"y":1847.7157614750445,"x":-2116.2170004397385}],[{"z":7000.0000000000009,"y":1847.7157614750445,"x":-2116.2170004397385},{"z":7000.0000000000009,"y":1847.7157614750374,"x":108.78299956026373}],[{"z":7000.0000000000009,"y":1847.7157614750374,"x":108.78299956026378},{"z":7000.0000000000009,"y":4312.7157614750367,"x":108.78299956026775}],[{"z":7000.0000000000009,"y":4312.7157614750367,"x":108.78299956026775},{"z":7000.0000000000009,"y":4457.7157614750367,"x":108.782999560268}],[{"z":7000.0000000000009,"y":4457.7157614750367,"x":108.782999560268},{"z":7000.0000000000009,"y":6067.7157614750377,"x":108.7829995602706}],[{"z":7000.0000000000009,"y":6067.7157614750367,"x":108.7829995602706},{"z":7000.0000000000009,"y":6067.7157614750558,"x":-5571.2170004397294}]]]} , id=306808, levelId=, maxPt=[x=108.782995203586, y=6067.7155184672, z=6999.99971965479], minPt=[x=-5571.21677731631, y=1847.71568747529, z=6999.99971965479], name=露台 12] [boundary={"version":"2.0","loops":[[[{"z":7000.0000000000009,"y":4167.7157614750313,"x":2238.78299956027},{"z":7000.0000000000009,"y":4167.7157614750367,"x":398.7829995602674}],[{"z":7000.0000000000009,"y":4167.7157614750367,"x":398.78299956026751},{"z":7000.0000000000009,"y":1847.7157614750361,"x":398.7829995602637}],[{"z":7000.0000000000009,"y":1847.7157614750363,"x":398.7829995602637},{"z":7000.0000000000009,"y":1847.7157614750306,"x":2238.7829995602669}],[{"z":7000.0000000000009,"y":1847.7157614750306,"x":2238.7829995602669},{"z":7000.0000000000009,"y":4167.7157614750313,"x":2238.78299956027}]]]} , id=306811, levelId=, maxPt=[x=2238.78290989854, y=4167.71559456087, z=6999.99971965479], minPt=[x=398.782983589278, y=1847.71568747528, z=6999.99971965479], name=卫生间 13] [boundary={"version":"2.0","loops":[[[{"z":7000.0000000000009,"y":4167.7157614750149,"x":7038.7829995602679},{"z":7000.0000000000009,"y":4167.71576147503,"x":2528.7829995602706}],[{"z":7000.0000000000009,"y":4167.71576147503,"x":2528.7829995602706},{"z":7000.0000000000009,"y":1847.7157614750295,"x":2528.7829995602665}],[{"z":7000.0000000000009,"y":1847.7157614750295,"x":2528.7829995602665},{"z":7000.0000000000009,"y":1847.7157614750151,"x":7038.7829995602642}],[{"z":7000.0000000000009,"y":1847.7157614750151,"x":7038.7829995602642},{"z":7000.0000000000009,"y":4167.7157614750149,"x":7038.7829995602679}]]]} , id=306814, levelId=, maxPt=[x=7038.78271766183, y=4167.71559456087, z=6999.99971965479], minPt=[x=2528.78289828424, y=1847.71568747526, z=6999.99971965479], name=露台 14] [boundary={"version":"2.0","loops":[[[{"z":7000.0000000000009,"y":1302.7157614750142,"x":7038.7829995602624},{"z":7000.0000000000009,"y":1557.7157614750149,"x":7038.7829995602642}],[{"z":7000.0000000000009,"y":1557.7157614750149,"x":7038.7829995602642},{"z":7000.0000000000009,"y":1557.7157614750295,"x":2528.7829995602665}],[{"z":7000.0000000000009,"y":1557.7157614750295,"x":2528.7829995602665},{"z":7000.0000000000009,"y":-3984.28423852497,"x":2528.7829995602574}],[{"z":7000.0000000000009,"y":-3984.28423852497,"x":2528.7829995602574},{"z":7000.0000000000009,"y":-3984.2842385249864,"x":7038.7829995602542}],[{"z":7000.0000000000009,"y":-3984.2842385249864,"x":7038.7829995602542},{"z":7000.0000000000009,"y":1302.7157614750142,"x":7038.7829995602624}]]]} , id=306817, levelId=, maxPt=[x=7038.78271766182, y=1557.71569908958, z=6999.99971965479], minPt=[x=2528.78289828423, y=-3984.28407895713, z=6999.99971965479], name=书房 15] [boundary={"version":"2.0","loops":[[[{"z":7000.0000000000009,"y":-6599.2842385249569,"x":-1971.2170004397512},{"z":7000.0000000000009,"y":-6599.2842385249542,"x":-2116.2170004397517}],[{"z":7000.0000000000009,"y":-6599.2842385249542,"x":-2116.2170004397517},{"z":7000.0000000000009,"y":-7644.2842385249514,"x":-2116.2170004397531}],[{"z":7000.0000000000009,"y":-7644.2842385249514,"x":-2116.2170004397531},{"z":7000.0000000000009,"y":-7644.2842385249542,"x":-1371.2170004397528}],[{"z":7000.0000000000009,"y":-7644.2842385249542,"x":-1371.2170004397528},{"z":7000.0000000000009,"y":-7644.2842385249642,"x":1638.7829995602526}],[{"z":7000.0000000000009,"y":-7644.2842385249642,"x":1638.7829995602526},{"z":7000.0000000000009,"y":-7644.284238524966,"x":2383.7829995602483}],[{"z":7000.0000000000009,"y":-7644.284238524966,"x":2383.7829995602483},{"z":7000.0000000000009,"y":-6839.2842385250142,"x":2383.7829995602497}],[{"z":7000.0000000000009,"y":-6839.2842385250142,"x":2383.7829995602497},{"z":7000.0000000000009,"y":-6694.284238524976,"x":2238.7829995602528}],[{"z":7000.0000000000009,"y":-6694.284238524976,"x":2238.7829995602528},{"z":7000.0000000000009,"y":-4274.28423852497,"x":2238.7829995602569}],[{"z":7000.0000000000009,"y":-4274.28423852497,"x":2238.7829995602569},{"z":7000.0000000000009,"y":-4274.284238524956,"x":-1971.2170004397469}],[{"z":7000.0000000000009,"y":-4274.284238524956,"x":-1971.2170004397474},{"z":7000.0000000000009,"y":-6599.2842385249569,"x":-1971.2170004397512}]]]} , id=306820, levelId=, maxPt=[x=2383.78290409137, y=-4274.2840673428, z=6999.99971965479], minPt=[x=-2116.21691568671, y=-7644.28393237662, z=6999.99971965479], name=书房 16] [boundary={"version":"2.0","loops":[[[{"z":7000.0000000000009,"y":1557.715761475067,"x":-9181.2170004397376},{"z":7000.0000000000009,"y":-3977.2842385249332,"x":-9181.2170004397449}],[{"z":7000.0000000000009,"y":-3977.2842385249337,"x":-9181.2170004397449},{"z":7000.0000000000009,"y":-3977.284238524956,"x":-2261.2170004397476}],[{"z":7000.0000000000009,"y":-3977.284238524956,"x":-2261.2170004397472},{"z":7000.0000000000009,"y":1557.7157614750445,"x":-2261.2170004397385}],[{"z":7000.0000000000009,"y":1557.7157614750447,"x":-2261.2170004397385},{"z":7000.0000000000009,"y":1557.7157614750558,"x":-5716.2170004397367}],[{"z":7000.0000000000009,"y":1557.7157614750558,"x":-5716.2170004397367},{"z":7000.0000000000009,"y":1557.715761475067,"x":-9181.2170004397376}]]]} , id=306823, levelId=, maxPt=[x=-2261.21690987955, y=1557.71569908962, z=6999.99971965479], minPt=[x=-9181.21663273829, y=-3977.28407923745, z=6999.99971965479], name=主卧 17] , elevation=7000, height=3500, id=259581, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/259581.png, name=F3, rooms=, structElev=7000] [archElev=10500, Areas=, elevation=10500, height=4000, id=259628, miniMap=m.bimface.com/f59e14129a8dd342eee5a606342dc862/resource/model/maps/259628.png, name=ROOF, rooms=, structElev=10500] ] [fileId=1689679293539776, floors=[archElev=-10000, Areas=, elevation=-10000, height=5400, id=274289, miniMap=m.bimface.com/b0106219d6df6da77b6493a0565d9e0e/resource/model/maps/274289.png, name=B2, rooms=, structElev=-10000] [archElev=-4600, Areas=, elevation=-4600, height=4500, id=694, miniMap=m.bimface.com/b0106219d6df6da77b6493a0565d9e0e/resource/model/maps/694.png, name=B1, rooms=, structElev=-4600] [archElev=-100, Areas=, elevation=-100, height=100, id=274497, miniMap=, name=L1, rooms=, structElev=-100] [archElev=0, Areas=, elevation=0, height=4100, id=311, miniMap=, name=0.000, rooms=, structElev=0] [archElev=4100, Areas=, elevation=4100, height=3800, id=274619, miniMap=, name=L2, rooms=, structElev=4100] [archElev=7900, Areas=, elevation=7900, height=3800, id=274687, miniMap=, name=L3, rooms=, structElev=7900] [archElev=11700, Areas=, elevation=11700, height=3800, id=274788, miniMap=, name=L4, rooms=, structElev=11700] [archElev=15500, Areas=, elevation=15500, height=3800, id=274917, miniMap=, name=L5, rooms=, structElev=15500] [archElev=19300, Areas=, elevation=19300, height=3800, id=275072, miniMap=, name=L6, rooms=, structElev=19300] [archElev=23100, Areas=, elevation=23100, height=4000, id=275221, miniMap=, name=屋顶层, rooms=, structElev=23100] [archElev=27100, Areas=, elevation=27100, height=4000, id=275375, miniMap=, name=机房层, rooms=, structElev=27100] ]
测试代码如下:
1 // 获取多模型的楼层信息 2 protected void btnGetMultipleModelFloors_Click(object sender, EventArgs e) 3 { 4 string[] fileIds = txtFileID.Text.Split(‘,‘); 5 FileConvertApi api = new FileConvertApi(); 6 MultipleModelsFloors response = api.GetMultipleModelFloors(txtAccessToken.Text, fileIds, chkIncludeArea.Checked, chkIncludeRoom.Checked); 7 8 StringBuilder sb = new StringBuilder(); 9 List<MultipleModelsFloorsEntity> lstFloor = response.Data; 10 foreach (var floor in lstFloor) 11 { 12 sb.AppendLine(floor.ToString()); 13 } 14 15 txtResult.Text = response.Code.ToString2() 16 + Environment.NewLine 17 + response.Message.ToString2() 18 + Environment.NewLine 19 + sb; 20 }