Using Transform Assembly Occurrences API Call
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:
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
Thanks,
Matt
Tagged:
0
Comments
-
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 }0
Categories
- All Categories
- 10.2K Community Support
- 4.6K General
- 194 Account and subscriptions
- 353 Data management
- 1.6K Product Feedback
- 215 New in Onshape
- 14 Onshape Labs
- 75 CAM Studio
- 35 PCB Studio
- 107 Simulation
- 209 Onshape Mobile
- 315 App Store & Partners Apps
- 8.2K Using Onshape
- 1.8K Drawings
- 2.3K FeatureScript
- 324 Learning Center
- 253 Education Community