0

Hi I am using a custom app to generate drawings and export dwg/png/pdf. Local test on Autocad 2016 is good, but when uploading activity, server can't export pdf.

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

it is on core engine v21.

AIO report:

[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

This 'Layout not foundCoreHeartBeat' is odd...Any tip, please? Thank you!

Edited: I also tried

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

No luck.

I changed to print pdf from model space

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

Yes, png file reflects layout but we loose layout in pdf.

We thought the problem might be from that we created a new layout in paper space:

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

So we commented out the create layout part,fine tuned the code for export, had it tested with local success:

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

Again, no pdf file. But this time the report changed:

[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

Now it is 'There were no plottable sheets in the current operation'.

rock-paper
  • 93
  • 1
  • 9

1 Answers1

0

Have you tried changing "C" to "_C"?

Albert Szilvasy
  • 461
  • 3
  • 5
  • I can't repro this problem. I built an app to do what you are doing: https://github.com/szilvaa/design.automation-.net-custom.activity.sample I suspect the problem is drawing specific. – Albert Szilvasy Mar 15 '17 at 23:23
  • Thank you for doing this Albert! You are probably right...I changed to different Resource files, the report just showed all kinds of funny ways. Digging into it... – rock-paper Mar 16 '17 at 22:34