Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

REST API - Exporting a part to STEP works, but exporting to DXF does not

guillauem_dguillauem_d Member Posts: 16
Hello there !  :D

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 inputing STEP as formatName
  • Wait for the /api/v8/translations/{requestId}  requestState to be DONE
  • Download the STEP using /api/v8/translations/{requestId}
The problem is that exporting to a DXF using the same method doesn't work, I know that it's probably because i'm not telling the code which face to export (just like I would manually), but I don't know how do input that.
Where should i plug the face ID ? Here is my working code for STEP files : 

payload = {
    "allowFaultyParts": True,
    "angularTolerance": 0.001,
    "formatName": "STEP",
    "storeInDocument": True,
}

response = requests.post(
        DID, WID, EID
    ),
    auth=(API_ACCESS, API_SECRET),
    headers={
        "Accept": "application/json;charset=UTF-8; qs=0.09",
        "Content-Type": "application/json",
    },
    json=payload
)

What changes should I make to make it work with DXF ?

Thank you in advance !  :)
Sign In or Register to comment.