Forge API查询BIM360 Revit文件转换结果缺失IFC衍生文件问题
问题场景
我尝试直接转换BIM360中的Revit文件,相关代码和返回结果如下:
提交转换任务代码
List<JobPayloadItem> outputs = new List<JobPayloadItem> { new (JobPayloadItem.TypeEnum.Ifc) }; string workFlowId = Guid.NewGuid().ToString(); JobPayloadMisc misc = new JobPayloadMisc(workFlowId); JobPayloadDestination.RegionEnum destinationRegion = JobPayloadDestination.RegionEnum.US; JobPayloadDestination destination = new JobPayloadDestination(destinationRegion); JobPayload payload = new JobPayload(new JobPayloadInput(base64Urn), new JobPayloadOutput(outputs, destination), misc); m_api.Configuration.AccessToken = accessToken; DynamicJsonResponse response = await m_api.TranslateAsync(payload, true);
查询转换结果代码
DynamicJsonResponse result = await m_api.GetManifestAsync(base64Urn);
问题表现
返回的转换结果清单中没有IFC衍生文件的转换任务记录,返回内容如下(隐私信息已用*****替换):
{ "urn": "*****", "derivatives": { "0": { "hasThumbnail": "true", "overrideOutputType": "svf2", "children": { "0": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/model.sdb", "role": "Autodesk.CloudPlatform.PropertyDatabase", "mime": "application/autodesk-db", "guid": "6fac95cb-af5d-3e4f-b943-8a7f55847ff1", "type": "resource", "status": "success" }, "1": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/AECModelData.json", "role": "Autodesk.AEC.ModelData", "mime": "application/json", "guid": "a4aac952-a3f4-031c-4113-b2d9ac2d0de6", "type": "resource", "status": "success" }, "2": { "guid": "86dcdfb0-d97d-e3d7-3404-b53abf1678b1", "phaseNames": "New Construction", "hasThumbnail": "true", "role": "3d", "name": "3D", "progress": "complete", "type": "geometry", "viewableID": "92b5dec7-790a-45b0-a5e8-cd9f76058c3a-009a4098", "status": "success", "children": { "0": { "guid": "92b5dec7-790a-45b0-a5e8-cd9f76058c3a-009a4098", "role": "3d", "name": "3D", "progress": "complete", "camera": { "0": 625.0464477539063, "1": -563.9346313476563, "2": 833.3741455078125, "3": 96.7083740234375, "4": -35.5965690612793, "5": 305.0361022949219, "6": -0.40824830532073977, "7": 0.40824830532073977, "8": 0.8164966106414795, "9": 0.6307491064071655, "10": 0, "11": 1, "12": 1 }, "type": "view", "status": "success" }, "1": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/3D View/3D/3D.svf", "role": "graphics", "mime": "application/autodesk-svf", "guid": "fbec8b0f-58d6-2e86-30c8-211e4056efeb", "type": "resource" }, "2": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/3D View/3D/3D1.png", "role": "thumbnail", "mime": "image/png", "guid": "c70aa596-d404-714f-6795-9276087c3800", "type": "resource", "resolution": { "0": 100, "1": 100 }, "status": "success" }, "3": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/3D View/3D/3D2.png", "role": "thumbnail", "mime": "image/png", "guid": "6ef65d1a-4a59-111d-f1ec-4e543bd2712b", "type": "resource", "resolution": { "0": 200, "1": 200 }, "status": "success" }, "4": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/3D View/3D/3D4.png", "role": "thumbnail", "mime": "image/png", "guid": "2c06739e-5164-4f6d-450e-c8833fd2a2ba", "type": "resource", "resolution": { "0": 400, "1": 400 }, "status": "success" } } }, "3": { "isMasterView": true, "phaseNames": "New Construction", "hasThumbnail": "true", "role": "3d", "children": { "0": { "guid": "c884ae1b-61e7-4f9d-0001-719e20b22d0b-009a40af", "role": "3d", "name": "New Construction", "progress": "complete", "camera": { "0": 594.0901489257813, "1": -500.6220397949219, "2": 819.0045166015625, "3": 95.86978149414063, "4": -2.4016761779785158, "5": 320.78411865234377, "6": -0.40824830532073977, "7": 0.40824830532073977, "8": 0.8164966106414795, "9": 0.3480738401412964, "10": 0, "11": 1, "12": 1 }, "type": "view", "status": "success" }, "1": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/3D View/*****/New Construction/New Construction.svf", "role": "graphics", "mime": "application/autodesk-svf", "guid": "3572dadf-f7d8-cf8b-a625-967f27309e85", "type": "resource" }, "2": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/3D View/*****/New Construction/New Construction1.png", "role": "thumbnail", "mime": "image/png", "guid": "a3c19573-8948-7ae0-fb5c-75cab1d0e87a", "type": "resource", "resolution": { "0": 100, "1": 100 }, "status": "success" }, "3": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/3D View/*****/New Construction/New Construction2.png", "role": "thumbnail", "mime": "image/png", "guid": "86d53dd2-82c8-1948-5997-00ebf6078ed7", "type": "resource", "resolution": { "0": 200, "1": 200 }, "status": "success" }, "4": { "urn": "urn:adsk.viewing:fs.file:*****/output/Resource/3D View/*****/New Construction/New Construction4.png", "role": "thumbnail", "mime": "image/png", "guid": "7e36c074-8997-d941-4dc3-6a72fcdf3b9b", "type": "resource", "resolution": { "0": 400, "1": 400 }, "status": "success" } }, "name": "New Construction", "guid": "4b621e7d-f520-422b-95fd-645b8690168a", "progress": "complete", "type": "geometry", "viewableID": "c884ae1b-61e7-4f9d-0001-719e20b22d0b-009a40af", "status": "success" } }, "name": "*****.rvt", "progress": "complete", "messages": { "0": { "type": "warning", "code": "Revit-MissingLink", "message": { "0": "Missing link files: <ul>{0}</ul>", "1": "08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg" } } }, "outputType": "svf", "status": "success" }, "1": { "children": { "0": { "urn": "urn:adsk.viewing:fs.file:*****/output/preview1.png", "role": "thumbnail", "mime": "image/png", "guid": "db899ab5-939f-e250-d79d-2d1637ce4565", "type": "resource", "resolution": { "0": 100, "1": 100 }, "status": "success" }, "1": { "urn": "urn:adsk.viewing:fs.file:*****/output/preview2.png", "role": "thumbnail", "mime": "image/png", "guid": "3f6c118d-f551-7bf0-03c9-8548d26c9772", "type": "resource", "resolution": { "0": 200, "1": 200 }, "status": "success" }, "2": { "urn": "urn:adsk.viewing:fs.file:*****/output/preview4.png", "role": "thumbnail", "mime": "image/png", "guid": "4e751806-0920-ce32-e9fd-47c3cec21536", "type": "resource", "resolution": { "0": 400, "1": 400 }, "status": "success" } }, "progress": "complete", "outputType": "thumbnail", "status": "success" } }, "hasThumbnail": "true", "messages": { "0": { "type": "warning", "code": "Revit-MissingLink", "message": { "0": "Missing link files: <ul>{0}</ul>", "1": "08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg, 08.12.2019. *****.dwg" } } }, "progress": "99% complete", "type": "manifest", "region": "US", "version": "1.0", "status": "inprogress" }
问题原因及修复方案
- 权限配置问题:BIM360项目默认禁止第三方应用导出IFC格式,需要项目管理员在BIM360管理后台开启对应项目的「允许IFC导出」权限,同时确保你的Forge应用已被该BIM360项目授权,且请求用的AccessToken包含
data:write权限域。 - 转换请求参数缺失:仅指定输出格式为IFC不足以触发转换,需要补充IFC导出配置,比如指定Revit IFC导出版本、导出的视图/图纸范围等参数,示例配置如下:
var ifcOptions = new Dictionary<string, object> { { "exportBaseQuantities", true }, { "ifcVersion", "IFC2x3" }, { "exportViewableId", "指定需要导出的Revit视图ID,可选" } }; var outputItem = new JobPayloadItem(JobPayloadItem.TypeEnum.Ifc, ifcOptions); - 强制转换参数逻辑问题:
TranslateAsync的第二个参数为x-ads-force标识,设为true时仅当目标衍生文件不存在时才会触发转换,如果你之前提交过无效的IFC转换请求,可尝试删除现有manifest后重新提交转换,确保触发新的转换任务。 - 查询时机问题:返回结果中manifest状态为`inprogress
相关产品推荐
相关产品推荐

