0

I've written an AutoCAD command in C#/.NET that finds a table in a DWG file and fills that table with some data. Then it publishes a PDF file from the DWG using code very similar to the code found here.

This command works fine on desktop AutoCAD no problem. In Forge Design Automation, it works fine except for DWG files that were generated by one of our other commands - for these files, we get "failedInstructions", and the job report contains this weird "Loading Mechanical modules" message that I never see when a job runs successfully. Here's a snippet of a sample report:

[09/16/2021 13:51:33] Version Number: R.47.Z.170 (UNICODE)
[09/16/2021 13:51:35] Loading Mechanical modules.....
[09/16/2021 13:51:37] Loader application completed
[09/16/2021 13:51:38] Regenerating layout.
[09/16/2021 13:51:38] Regenerating model.
[09/16/2021 13:51:39] ERROR: Something went wrong. ErrorStatus=53.

Now, if I take that same input DWG file, load it up in AutoCAD desktop and save it manually, then use that version of the file as input to my Forge Design Automation job, it succeeds. And I don't get that "Loading Mechanical Modules" message in the report:

[09/16/2021 14:40:46] Version Number: R.47.Z.170 (UNICODE)
[09/16/2021 14:40:47] Regenerating layout.
[09/16/2021 14:40:47] Regenerating model.
[09/16/2021 14:40:48] AutoCAD menu utilities loaded.
[09/16/2021 14:40:48] Command:
[09/16/2021 14:40:48] Command:
[09/16/2021 14:40:48] Command:
[09/16/2021 14:40:48] Command: (command "SETTITLEBLOCKPARAMETERS")

Furthermore, I don't think this is necessarily a problem with my code, because I can reproduce this behavior with Autodesk's standard "AutoCAD.PlotToPDF+prod" activity. In other words, a given DWG file that fails in my activity also fails in "AutoCAD.PlotToPDF+prod", and a DWG file that succeeds in one also succeeds in the other.

Does anyone know what this "Loading Mechanical modules" message means, and why a given Design Automation (AutoCAD) activity might only succeed with a DWG file that has been saved manually in AutoCAD desktop but not a DWG file that was generated automatically from a template (DWT) by another Design Automation activity?

EDIT: Here's a sample DWG file that, when used as an input to the standard "AutoCAD.PlotToPDF+prod" design automation activity, results in the Error 53 (along with the "Loading mechanical modules" message): https://drive.google.com/file/d/1_vKqg_Ies4SUqT08tET-zSK-NESHcPby/view?usp=sharing

  • Is it possible you to share the drawing or test the drawing in accoreconsole locally ? `ERROR: Something went wrong. ErrorStatus=53.` This indicates a filerError https://forums.autodesk.com/t5/net/errorstatus-53-again/td-p/9443911 . I suspect the drawing contains Mechanical objects, which accoreconsole is not able to recognize. – Madhukar Moogala Sep 16 '21 at 16:17
  • @MadhukarMoogala here's a sample DWG that fails when used as an input to the standard "AutoCAD.PlotToPDF+prod" design automation activity: https://drive.google.com/file/d/1_vKqg_Ies4SUqT08tET-zSK-NESHcPby/view?usp=sharing – christopher Sep 16 '21 at 19:21
  • Thanks for providing the drawing, we have filed a change request with our Engineering team, I will keep updated. – Madhukar Moogala Sep 17 '21 at 07:56
  • @MadhukarMoogala I think I've come up with a fix. This drawing was created by another Forge Design Automation activity using, and that activity will import blocks from one or more other DWG files (we can call these "source" DWG files). It turns out these source DWG files were created using a program other than AutoCAD. So my guess is that these source DWG files have some junk in them that AutoCAD can't deal with, and so they end up in the finished DWG file. And then that DWG can't be processed in Forge again. So I've found running -EXPORTTOAUTOCAD on the source files fixes it. – christopher Sep 22 '21 at 13:45
  • thanks for your update and hint. -EXPORTTOAUTOCAD will clear of the intelligence on the blocks that are imported from other toolsets. The drawing works good in accoreconsole, locally, I have ACADM, ACA toolset installed. – Madhukar Moogala Sep 23 '21 at 11:53

0 Answers0