Forge API 将 {URL}/workitems 的 InventorParams 转换为支持的格式,如 svf、dwg
Forge API to translate InventorParams of {URL}/workitems into supported format like svf,dwg
不知道如何将模型 InventorParams.url 转换为任何支持的格式,例如 SVF、DWG、Obj
通过 axios
在端点 /workitems 上发送数据:{InventorParams.url}
axios({
method: 'POST',
url: 'https://developer.api.autodesk.com/da/us-east/v3/workitems',
headers: {
'Authorization': 'Bearer ******',
'content-type': 'application/json'
},
data: JSON.stringify({
activityId: 'BAsBRLiyiaHR1X9eYiAI4ATPmdcuZ5Pf.NamiliftActivity+beta',
arguments: {
InventorDoc: {
url: 'https://developer.api.autodesk.com/oss/v2/signedresources/1a2ac1d9-a8af-4aa2-b9d1-8b0fde21bcf3?region=US',
pathInZip: 'MasterAssembly.iam'
},
InventorParams: {
url: 'data:application/json,{"ProjectNumber":"12345","ProjectName":"8000-2016","PreparedBy":"Nami","DrawingNumber":"Nami","CommissionNumber":"","ElevatorDesignation":"","ElevatorNumber":"","Logo":"NamiLift","LanguageOptions":"ENG","Standard":"PL400","NumberOfFloor":2,"LengthOfCar":2000,"WidthOfCar":1100,"Pits":true,"PitHeight":50,"ZoneSectionStart":239,"HeightAboveTopElevator":0,"ElectricBoxSide":"a","ElectricBoxFloorNo":"0","ElectricBoxDefault":false,"OuterRoof":false,"OuterRoofSide":"A","WindowsSectionA":"0-0","WindowsSectionB":"0-5000","WindowsSectionC":"0-0","WindowsSectionD":"0-0","DefaultDoorSize":false,"Colorelevator":"RAL 9001","Colordoor":"RAL 9001","Safelinemx2":false,"Safelinemx2gsm":false,"Schoolcontrolassa":false,"Schoolcontrol":false,"Intercom":false,"Callsend":false,"Firealarmdrive":false,"Folderseat":false,"Floorvoiceannouncement":false,"Lsfcable":false,"Telephone":false,"Keyswitch":false,"Ups":false,"Comments":"-","LiftHeightLevel0":0,"DoorSideLevel0":"A","TypeOfDoorLevel0":"A1","DoorHingeLevel0":"Right","DoorSizeLevel0":900,"DoorHeightLevel0":2000,"DoorCloserLevel0":true,"CanopyLevel0":true,"CallBoxLevel0":true,"LiftHeightLevel1":5000,"DoorSideLevel1":"A","TypeOfDoorLevel1":"A1","DoorHingeLevel1":"Right","DoorSizeLevel1":900,"DoorHeightLevel1":2000,"DoorCloserLevel1":false,"CanopyLevel1":false,"CallBoxLevel1":false}',
'OutputPDF': {
'url': fileName.resultZipUrl,
'headers': {
'Authorization': 'Bearer ' + values.access_token,
'Content-type': 'application/octet-stream'
},
'verb': 'put'
},
onComplete: 'onComplete': {
'verb': 'post',
'url': config.credentials.callback_url +'/api/forge/datamanagement/signanddownload'
}
}
}
})
WorkItem 输出
{"status":"pending","stats":{"timeQueued":"2022-02-09T03:31:43.525012Z"},"id":"27fa82758b794111a91025ed69da6fec"}
这是该 InventorParams 的工作项/:id 响应
这是我从 workitem/:id 响应的 reportUrl 获取的 txt 文件
来自 report.txt 文件 oss/v2/signedresources GET ZIP(InventorDoc.pathInZip 名称)包含此内容
您粘贴的 activity 似乎只是关于为给定 [=17] 的绘图创建 PDF =]Inventor 模型 - 请参阅 OutputPDF 输出参数。
InventorParams 只是为 工作项 提供了一个 json 文件app bundle 中的代码可以读取,并使用其中的值使用 Inventor API 相应地修改模型。 =11=]
为了更好地理解 输入和输出参数 ,包括 json 文件如何被 app bundle,请看这里的教程:
https://learnforge.autodesk.io/#/tutorials/modifymodels
不知道如何将模型 InventorParams.url 转换为任何支持的格式,例如 SVF、DWG、Obj
通过 axios
在端点 /workitems 上发送数据:{InventorParams.url}axios({
method: 'POST',
url: 'https://developer.api.autodesk.com/da/us-east/v3/workitems',
headers: {
'Authorization': 'Bearer ******',
'content-type': 'application/json'
},
data: JSON.stringify({
activityId: 'BAsBRLiyiaHR1X9eYiAI4ATPmdcuZ5Pf.NamiliftActivity+beta',
arguments: {
InventorDoc: {
url: 'https://developer.api.autodesk.com/oss/v2/signedresources/1a2ac1d9-a8af-4aa2-b9d1-8b0fde21bcf3?region=US',
pathInZip: 'MasterAssembly.iam'
},
InventorParams: {
url: 'data:application/json,{"ProjectNumber":"12345","ProjectName":"8000-2016","PreparedBy":"Nami","DrawingNumber":"Nami","CommissionNumber":"","ElevatorDesignation":"","ElevatorNumber":"","Logo":"NamiLift","LanguageOptions":"ENG","Standard":"PL400","NumberOfFloor":2,"LengthOfCar":2000,"WidthOfCar":1100,"Pits":true,"PitHeight":50,"ZoneSectionStart":239,"HeightAboveTopElevator":0,"ElectricBoxSide":"a","ElectricBoxFloorNo":"0","ElectricBoxDefault":false,"OuterRoof":false,"OuterRoofSide":"A","WindowsSectionA":"0-0","WindowsSectionB":"0-5000","WindowsSectionC":"0-0","WindowsSectionD":"0-0","DefaultDoorSize":false,"Colorelevator":"RAL 9001","Colordoor":"RAL 9001","Safelinemx2":false,"Safelinemx2gsm":false,"Schoolcontrolassa":false,"Schoolcontrol":false,"Intercom":false,"Callsend":false,"Firealarmdrive":false,"Folderseat":false,"Floorvoiceannouncement":false,"Lsfcable":false,"Telephone":false,"Keyswitch":false,"Ups":false,"Comments":"-","LiftHeightLevel0":0,"DoorSideLevel0":"A","TypeOfDoorLevel0":"A1","DoorHingeLevel0":"Right","DoorSizeLevel0":900,"DoorHeightLevel0":2000,"DoorCloserLevel0":true,"CanopyLevel0":true,"CallBoxLevel0":true,"LiftHeightLevel1":5000,"DoorSideLevel1":"A","TypeOfDoorLevel1":"A1","DoorHingeLevel1":"Right","DoorSizeLevel1":900,"DoorHeightLevel1":2000,"DoorCloserLevel1":false,"CanopyLevel1":false,"CallBoxLevel1":false}',
'OutputPDF': {
'url': fileName.resultZipUrl,
'headers': {
'Authorization': 'Bearer ' + values.access_token,
'Content-type': 'application/octet-stream'
},
'verb': 'put'
},
onComplete: 'onComplete': {
'verb': 'post',
'url': config.credentials.callback_url +'/api/forge/datamanagement/signanddownload'
}
}
}
})
WorkItem 输出
{"status":"pending","stats":{"timeQueued":"2022-02-09T03:31:43.525012Z"},"id":"27fa82758b794111a91025ed69da6fec"}
这是该 InventorParams 的工作项/:id 响应
这是我从 workitem/:id 响应的 reportUrl 获取的 txt 文件
来自 report.txt 文件 oss/v2/signedresources GET ZIP(InventorDoc.pathInZip 名称)包含此内容
您粘贴的 activity 似乎只是关于为给定 [=17] 的绘图创建 PDF =]Inventor 模型 - 请参阅 OutputPDF 输出参数。
InventorParams 只是为 工作项 提供了一个 json 文件app bundle 中的代码可以读取,并使用其中的值使用 Inventor API 相应地修改模型。 =11=]
为了更好地理解 输入和输出参数 ,包括 json 文件如何被 app bundle,请看这里的教程: https://learnforge.autodesk.io/#/tutorials/modifymodels