Using Transform Assembly Occurrences API Call

matthew_mueller295
matthew_mueller295 Member Posts: 6 EDU
Hello,

I want to be able to move parts around in an assembly with an API Post, and believe the "Transform Assembly Occurrences" call will do that, but can't figure out the JSON syntax. I'm taking the occurrence string from the "Assembly Definition" Get request. Here is one of the request bodies I've tried:

{
  "occurrences": "{ "path" : [ "M+71F+lRPMmz6IrdH" ], "transform" : [ 0.0, 1.0, 0.0, -0.01222426182365419, -1.0, 0.0, 0.0, 7.397456422448163E-4, 0.0, 0.0, 1.0, 0.026334691189542413, 0.0, 0.0, 0.0, 1.0 ], "fixed" : false, "hidden" : false }",
  "occurrences.0": "{ "path" : [ "M+71F+lRPMmz6IrdH" ], "transform" : [ 0.0, 1.0, 0.0, -0.01222426182365419, -1.0, 0.0, 0.0, 7.397456422448163E-4, 0.0, 0.0, 1.0, 0.026334691189542413, 0.0, 0.0, 0.0, 1.0 ], "fixed" : false, "hidden" : false }",
  "occurrences.0.path": "M+71F+lRPMmz6IrdH",
  "transform": "[ 0.0, 1.0, 0.0, -0.01222426182365419, -1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.026334691189542413, 0.0, 0.0, 0.0, 1.0 ]",
  "isRelative": "False"
}

Thanks,
Matt

Comments

  • francesco_nori
    francesco_nori Member Posts: 4 ✭
    edited August 2021
    I have changed your body with the following and it worked:
    {
      "occurrences": [{ "path" : [ "M+71F+lRPMmz6IrdH" ]}],
      "transform": [ 0.0, 1.0, 0.0, -0.01222426182365419, -1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.026334691189542413, 0.0, 0.0, 0.0, 1.0 ],
      "isRelative": true
    }