Search code examples
autodesk-forgeautodesk-designautomation

DWG Sheet Combination failing on AutoDesk Forge


We are using Forge to import a STEP file into the modelspace of an output.DWG. Then a DLL combines modelspace geometry of several DWG files into several layout/paperspace of a single DWG. This sheet combination was working perfectly until just recently, when the combination process completely stopped happening.

Has something in Forge changed recently that we're not aware of? Updates/patches, or something like that which could have caused this issue?

This is an issue for a production application and is considered an outage at this point, and is very time-sensitive.

Edit: Here are some differences we noticed between the log files generated by this process. In this first section, the verbiage being written by AutoCAD has changed slightly during an extraction process:

[08/01/2019 17:15:35] End downloading https://.... 1556909 bytes have been unpacked to folder T:\Aces\Jobs\a43e5ca7faaa4db8b5374aaef71b36d3\cadlayouts.

[08/19/2019 17:25:53] End downloading file https://.... 1771363 bytes have been written to T:\Aces\Jobs\d12f3bed13b84d29b31226222e3cf3c9\cadlayouts.

In the log from 8/19, all lines logged in between:

Start AutoCAD Core Engine standard output dump.

And:

End AutoCAD Core Engine standard output dump.

Are being written twice, but this did not happen in the log file from August 1st or any of the logs before that date.

Edit 2: Yesterday we used the .NET DirectoryInfo class to pull all directories into one list and all files into another and write them all to the log. The cadlayouts entity that should be recognized as a directory (because it's a zip that is extracted by Forge) is instead listed as a file. Our process runs a Directory.Exists() check before the work item merges the DWGs into the output, and this call returns false for the cadlayouts folder, bypassing our combination logic. How can the Forge zip extraction process be working correctly if the resulting entity on the file system is not considered a directory?


Solution

  • It sounds like you have an input argument that is a zip and you expect it to be unzipped into a folder. Please look row 4 in the table below. I suspect that this is what you are experiencing. There WAS a recent change here: we used to look at downloaded bits and unconditionally uncompressed if we found a zip header. (i.e. we acted identically for row 3 and row 4). We now only do this if you ask us to do it.

    EDIT: The first column in the table is the value of the zip attribute of Activity's parameters while the second column is the pathInzip attribute of Workitem's arguments.

    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | # | Activity   | Workitem        | Arg direction | Comments                                                                                                                                                    |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 1 | zip==true  | pathInZip!=null | input         | Zip is uncompressed to the folder specified in localname. Any path reference to this argument will expand to full path of pathInZip.                        |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 2 | zip==false | pathInZip!=null | input         | Zip is uncompressed to the folder specified in localname. Any path reference to this argument will expand to full path of pathInZip.                        |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 3 | zip==true  | pathInZip==null | input         | If zip is provided then it is uncompressed to the folder specified in localname. Any path reference to this argument will expand to full path of localName. |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 4 | zip==false | pathInZip==null | input         | If zip is provided then it is left compressed. Any variable referencing this argument will expand to full path of localName.                                |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 5 | zip==true  | pathInZip!=null | output        | Workitem will be rejected.                                                                                                                                  |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 6 | zip==false | pathInZip!=null | output        | Workitem will be rejected.                                                                                                                                  |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 7 | zip==true  | pathInZip==null | output        | Output(s) at localName will be zipped if localName is a folder.                                                                                             |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 8 | zip==false | pathInZip==null | output        | Output at localName will not be zipped.                                                                                                                     |
    +---+------------+-----------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+