theandroid
theandroid

Reputation: 1043

CTB not applied when converting DWG to PDF using APS Design Automation V3 API

I am using Design Automation V3 endpoint with the pre-defined activity AutoCAD.PlotToPDF+prod I am observing that the styles defined in CTB are not taken into account on export to PDF. I am passing the CTB file in "References" object to the HostDwg as explained in Please let me know the script for applying ctb when converting DWG file to PDF

I downloaded the WorkItemStaus Report and see that the job information processes the CTB file that is being supplied in the references

[02/25/2025 16:17:03] Job information:
en{
"CommandLine": [
    "$(engine.path)\\accoreconsole.exe /i \"$(args[HostDwg].path)\" /s $(settings[script].path) /suppressGraphics"
],
"Settings": {
    "script": {
        "value": "_tilemode 0 -export _pdf _all result.pdf\n"
    },
    "dasOpenNetwork": {
        "value": "true",
        "isEnvironmentVariable": true
    }
},
"Id": "e2a31bb7228446899c643efe5783230f",
"ActivityId": "AutoCAD.PlotToPDF+prod",
"EngineId": "Autodesk.AutoCAD_25_0!39",
"Apps": [],
"BoundArguments": {
    "HostDwg": {
        "localName": "$(HostDwg)",
        "references": [
            {
                "localName": "CTB",
                "url": "urn:adsk.objects:os.object:dasplotting_4d9ba11747d148eda09c1cb1ee6d60bd/20250225111658_input_TEST.ctb",
                "headers": {
                    "Authorization": "Masked:t0afgbb36oH4lDJf80dG75J2ziY="
                },
                "verb": "get"
            }
        ],
        "url": "urn:adsk.objects:os.object:dasplotting_4d9ba11747d148eda09c1cb1ee6d60bd/20250225111658_input_XXX-PRN-3711-ONS-CCC-DES-DRG-00100.dwg",
        "headers": {
            "Authorization": "Masked:t0afgbb36oH4lDJf80dG75J2ziY="
        },
        "verb": "get"
    },
    "Result": {
        "localName": "result.pdf",
        "url": "urn:adsk.objects:os.object:dasplotting_4d9ba11747d148eda09c1cb1ee6d60bd/20250225111658_output_result.pdf",
        "headers": {
            "Authorization": "Masked:t0afgbb36oH4lDJf80dG75J2ziY="
        },
        "verb": "put"
    }
},
"Quotas": {
    "limitProcessingTimeSec": 900,
    "limitTotalUncompressedAppsSizeInMB": 500
}
}

However, the actual export command gives the error "Incompatible or missing plot style" and skips the ctb so the generated PDF has no styles.

enter image description here

Questions:

  1. Is Reference object to HostDWG is not how the CTB file should be supplied?
  2. The script command that gets executed does not have any argument to take the CTB? Is that the issue? If yes what is the script to provide ctb file as an argument?

Upvotes: 0

Views: 21

Answers (1)

theandroid
theandroid

Reputation: 1043

Learnt that there are 2 ways to address this:

  1. Adding references. Note: The exact ctb file name with its extension needs to be passed as explained in https://stackoverflow.com/a/55717191/6664129
  2. Alternatively, zip the drawing and ctb and pass it to the workitem and use pathInZip as explained in https://stackoverflow.com/a/79469421/6664129

Upvotes: 0

Related Questions