DWG在autodesk designautomation

时间:2017-03-12 11:18:20

标签: autodesk autodesk-forge autodesk-designautomation

您好我正在使用自定义应用生成图纸并导出dwg / png / pdf。 Autocad 2016上的本地测试很好,但在上传活动时,服务器无法导出pdf。

db.SaveAs(dwgOut, DwgVersion.Current);
ed.Command("_pngout", pngOut, "");
ed.Command("_tilemode", "0");
ed.Command("_-export", "_pdf", "C", "N", pdfOut);`

它位于核心引擎v21上。

AIO报告:

[03/12/2017 09:38:38] Command: _Customtest
[03/12/2017 09:38:38] Specify parameter file: params.json
[03/12/2017 09:38:38] Specify output folder: outputs
[03/12/2017 09:38:38] Regenerating layout.
[03/12/2017 09:38:38] Regenerating layout.
[03/12/2017 09:38:38] Regenerating model - caching viewports.
[03/12/2017 09:38:38] _pngout Enter file name <C:\Aces\Jobs\59ac1762d7c84db5a109ad8278685e7f\CustomtestTemplate.png>: outputs\test.png Select objects or <all objects and viewports>: _tilemode
[03/12/2017 09:38:38] Enter new value for TILEMODE <0>: 0 _-export Enter file format [Dwf/dwfX/Pdf] <dwfX>_pdf Enter plot area [Current layout/All layouts]<Current Layout>: C Detailed plot configuration? [Yes/No] <No>: N
[03/12/2017 09:38:38] Layout not foundCoreHeartBeat
[03/12/2017 09:38:38] Enter file name <CustomtestTemplate-NewLayout.pdf>: outputs\test.pdf
[03/12/2017 09:38:38] Command: _.quit

这个&#39;布局没找到CoreHeartBeat&#39;很奇怪......有什么提示吗?谢谢!

编辑: 我也试过

 ed.Command("_-export", "_pdf", "_C", "N", pdfOut);`

没有运气。

我改为从模型空间打印pdf

                ed.Command("_pngout", pngOut, "");
                ed.Command("_tilemode", "1");
                ed.Command("_.ZOOM", "_E");
                ed.Command("_-export", "_pdf", "d", "n", pdfOut);

是的,png文件反映了布局,但我们在pdf中放宽了布局。

我们认为问题可能源于我们在纸质空间中创建了一个新的布局:

var id = LayoutManager.Current.CreateAndMakeLayoutCurrent("testLayout");

因此,我们注释掉了创建布局部分,对导出的代码进行了微调,并在本地成功进行了测试:

                ed.Command("_pngout", pngOut, "");
                ed.Command("_tilemode", "0");
                ed.Command("_-export", "_pdf", "c", "n", pdfOut);

同样,没有pdf文件。但这次报告发生了变化:

[03/12/2017 23:47:13] Command: _Customtest
[03/12/2017 23:47:13] Specify parameter file: params.json
[03/12/2017 23:47:13] Specify output folder: outputs
[03/12/2017 23:47:13] _pngout Enter file name <C:\Aces\Jobs\b7b5c7d991f047df90fcbe33e80d0a86\CustomtestTemplate.png>: outputs\test.png Select objects or <all objects and viewports>: _tilemode
[03/12/2017 23:47:13] Enter new value for TILEMODE <1>: 0 Regenerating layout.
[03/12/2017 23:47:13] Regenerating layout.
[03/12/2017 23:47:13] Regenerating model - caching viewports.
[03/12/2017 23:47:13] _-export Enter file format [Dwf/dwfX/Pdf] <dwfX>_pdf Enter plot area [Current layout/All layouts]<Current Layout>: c Detailed plot configuration? [Yes/No] <No>: n
[03/12/2017 23:47:13] There were no plottable sheets in the current operation.Enter file name <CustomtestTemplate-Layout1.pdf>: outputs\test.pdf
[03/12/2017 23:47:13] Command: _.quit

现在它是&#39;当前操作中没有可绘制的表格。

1 个答案:

答案 0 :(得分:0)

您是否尝试将“C”更改为“_C”?