0

**Hi, i have a issue, i have some dwg export settings on my RVT file but submit job: https://aps.autodesk.com/en/docs/model-derivative/v2/reference/http/jobs/job-POST/ don’t see these and export to dwg with default settings.

I use python for my web app.**

import base64
from typing import Dict, List
from .auth import BaseOAuthClient, Scope, TokenProviderInterface

BASE_URL = https://developer.api.autodesk.com/modelderivative/v2
READ_SCOPES = [Scope.DATA_READ, Scope.VIEWABLES_READ]
WRITE_SCOPES = [Scope.DATA_CREATE, Scope.DATA_WRITE, Scope.DATA_READ]



def submit_job(self, urn: str, output_formats: List[Dict], **kwargs) -> Dict:
    
    json = {
        "input": {
            "urn": urn
        },
        "output": {
            "formats": output_formats,
            "destination": {
                "region": kwargs["output_region"] if "output_region" in kwargs else "EMEA"
            }
        }
    }
    if "root_filename" in kwargs:
        json["input"]["compressedUrn"] = True
       json["input"]["rootFilename"] = kwargs["root_filename"]
    if "workflow_id" in kwargs:
        json["misc"] = { "workflowId": kwargs["workflow_id"] }
        if "workflow_attr" in kwargs:
            json["misc"]["workflowAttribute"] = kwargs["workflow_attr"]
    headers = {}
    if "force" in kwargs:
        headers["x-ads-force"] = "true"
    return self._post("/regions/eu/designdata/job", scopes=WRITE_SCOPES, json=json, headers=headers).json()

main:

md.submit_job(urn,[{'type':'dwg'}])

1 Answers1

0

The default settings mentioned in the API documentation are the default values defined in ExportDWGSettings of Revit API, like the one below.

ExportDWGSettings settings = null;

using (var trans = new Transaction(document, "Create the ExportDWGSettings with defaults"))
{
    trans.Start();
    settings = ExportDWGSettings.Create(document, "Export DWG Default");
    trans.Commit();
}

DWGExportOptions exportOpts = settings?.GetDWGExportOptions();

document.Export(exportPath, filename, ids, exportOpts);

To use your specific DWG export settings, please specify your export settings name in the advanced.exportSettingName like the following.

curl --location 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job' \
--header 'Authorization: Bearer {{accessToken}}' \
--header 'Content-Type: application/json' \
--data '{
   "input": {
     "urn": "{{URN}}"
   },
   "output": {
     "formats": [
       {
         "type": "dwg",
         "views": [
           "2d"
         ],
         "advanced": {
           "exportSettingName": "My DWG export settings v1"
         }
       }
     ]
   }
 }'
Eason Kang
  • 6,155
  • 1
  • 7
  • 24
  • Thanks a lot but i use also: md.submit_job(urn,[{'type':'dwg','views':['2d'],'advanced':{'exportSettingName':'Configura 1'}}]) but i don't see my dwg settings 'Configura 1' – Luis Burgos Jul 17 '23 at 09:47
  • Might need to look into the file. Could you share a test RVT file reproducing this issue to `aps (DOT) help (AT) autodesk (DOT) com` for investigation? No need to share the whole file, just remaining partial objects and DWG expert settings inside should be enough. – Eason Kang Jul 19 '23 at 02:06