REST API - Exporting to STEP works, but exporting to OBJ does not

guillauem_d
guillauem_d Member Posts: 20 ✭✭
edited October 2024 in Community Support

Hello there ! πŸ˜‰

I'm trying to export my sheet metal part using the REST API, exporting it to a STEP file works fine using the following method :

β€’ Initiate the exporting procedure using /api/v6/assemblies/d/{}/w/{}/e/{}/translations
and payload = { "allowFaultyParts": True, "angularTolerance": 0.001, "formatName": "STEP", "storeInDocument": True, }
β€’ Wait for the /api/v8/translations/{requestId} requestState to be DONE
β€’ Download the STEP using /api/v8/translations/{requestId}


It works great, but now changing β€˜β€™formatName’’ to β€˜β€™OBJ’’ gives me the following error "Invalid resolution parameters were specified"

What changes to the payload should I make to make it work with OBJ ?

Thank you in advance !

Best Answer

  • Caden_Armstrong
    Caden_Armstrong Member Posts: 472 PRO
    Answer βœ“

    Each file format requires different inputs. Same as the user interface shows different options.
    For OBJ Files you need to include resolution="fine". other values are "coarse","medium", and then I think you can do custom with some other additional properties such as distanceTolerance, maximumChordLength, angular tolerance.

    www.smartbenchsoftware.com ---Β RenaissanceΒ --- KestrelΒ -- SmartLink
    Experts in Onshape Automation - Custom Features and Integrated Applications

Answers

  • Caden_Armstrong
    Caden_Armstrong Member Posts: 472 PRO
    Answer βœ“

    Each file format requires different inputs. Same as the user interface shows different options.
    For OBJ Files you need to include resolution="fine". other values are "coarse","medium", and then I think you can do custom with some other additional properties such as distanceTolerance, maximumChordLength, angular tolerance.

    www.smartbenchsoftware.com ---Β RenaissanceΒ --- KestrelΒ -- SmartLink
    Experts in Onshape Automation - Custom Features and Integrated Applications
  • guillauem_d
    guillauem_d Member Posts: 20 ✭✭

    Indeed, after adding the resolution paramater, it works perfectly, thank you so much ! 😁