【问题标题】:DWG to DGN conversion using Design Automation API使用设计自动化 API 将 DWG 转换为 DGN
【发布时间】:2019-08-04 00:07:25
【问题描述】:

是否有可能使用 Forge 设计自动化 api 从 dwg 转换为 dgn?如果是,那么最好的方法是什么?任何建议都会有所帮助。

【问题讨论】:

    标签: autodesk-designautomation


    【解决方案1】:

    是的,您可以在脚本中使用 -DGNEXPORT 命令来完成此操作。

    【讨论】:

      【解决方案2】:

      我试图获得这个问题的具体代码,因为它需要一些技巧和对设计自动化种子文件的支持。在工程师团队的帮助下,现在可以正常使用了。

      假设我们使用 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": ""
      }
      

      如果使用 Design Automation 的 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>"
         }
       }
       }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-01-10
        • 2020-10-12
        • 2019-01-07
        • 2019-07-23
        • 2021-12-26
        • 2020-04-13
        • 2017-07-02
        • 2020-01-15
        相关资源
        最近更新 更多