是否有可能使用 forge 设计自动化 api 从 dwg 转换为 dgn?如果是,那么最好的方法是什么?任何建议都会有所帮助。
问问题
123 次
2 回答
0
是的,您可以在脚本中使用 -DGNEXPORT 命令来完成此操作。
于 2019-03-13T21:50:04.397 回答
0
我试图为这个问题获得一个具体的代码,因为它需要一些技巧和对设计自动化种子文件的支持。在工程师团队的帮助下,现在可以正常工作了。
假设我们使用 Postman 进行测试。如果您使用的是设计自动化 v2,下面的脚本演示了用法。
活动:
{
"HostApplication": "",
"RequiredEngineVersion": "23.1",
"Parameters": {
"InputParameters": [{
"Name": "HostDwg",
"LocalFileName": "$(HostDwg)"
}],
"OutputParameters": [{
"Name": "Result",
"LocalFileName": "result.dgn"
}]
},
"Instruction": {
"CommandLineParameters": null,
"Script":"(command \"_-DGNEXPORT\" \"_V8\" (strcat (getvar \"DWGPREFIX\")
\"result.dgn\") \"_Master\" \"Standard\" (strcat (getvar \"LOCALROOTPREFIX\")
\"Template\\\\V8-Imperial-Seed3D.dgn\"))\n"
},
"Version": 1,
"Id": "CreateActByLISP"
}
工作项:
{
"@odata.type": "#ACES.Models.WorkItem",
"Arguments": {
"InputArguments": [
{
"Resource": "http://forge-test.oss-cn-shanghai.aliyuncs.com/test.dwg",
"Name": "HostDwg",
"StorageProvider": "Generic"
}
],
"OutputArguments": [
{
"Name": "Result",
"StorageProvider": "Generic",
"HttpVerb": "POST",
"Resource": null
}
]
},
"ActivityId": "CreateActByLISP",
"Id": ""
}
如果使用v3的设计自动化,脚本将如下所示。注意:引擎需要 23.1 (Autodesk.AutoCAD+23_1)
活动
{
"commandLine": [
"$(engine.path)\\accoreconsole.exe /i $(args[HostDwg].path) /s $(settings[script].path)"
],
"parameters": {
"HostDwg": {
"verb": "get",
"description": "Host drawing to be loaded into acad.",
"localName": "$(HostDwg)"
},
"Result": {
"verb": "post",
"description": "Results",
"localName": "result.dgn"
}
},
"engine": "Autodesk.AutoCAD+23_1",
"appbundles": [],
"settings": {
"script": {
"value": "(command \"_-DGNEXPORT\" \"_V8\" (strcat (getvar \"DWGPREFIX\") \"result.dgn\") \"_Master\" \"Standard\" (strcat (getvar \"LOCALROOTPREFIX\") \"Template\\\\V8-Imperial-Seed3D.dgn\"))\n"
}
},
"description": "PlotToPdf for all layouts.",
"id": "myexportdgn"
}
工作项:
{
"activityId": "{{your nick name}}.myexportdgn+{{activity alias}}",
"arguments": {
"HostDwg": {
"url": "http://forge-test.oss-cn-shanghai.aliyuncs.com/test.dwg"
},
"Result": {
"verb": "put",
"url": "<your upload url>"
}
}
}
于 2019-05-10T06:41:04.287 回答