0

您好我正在使用自定义应用程序来生成图纸并导出 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

这个 'Layout not foundCoreHeartBeat' 很奇怪……请问有什么提示吗?谢谢!

编辑:我也试过

 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

现在是“当前操作中没有可打印的工作表”。

4

1 回答 1

0

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

于 2017-03-12T16:18:08.550 回答