transform_instance
Apply a relative transform to an Onshape assembly instance: translate in mm or inches, rotate in degrees. Fixed or grounded instances are rejected, so verify the fixed flag first.
Instructions
Apply a RELATIVE transform to an assembly instance. Translations: bare numbers = mm; strings like "20 mm" / "0.5 in" for explicit units. Rotations: degrees. Note: fails on fixed/grounded instances — use get_assembly_positions to check the 'fixed' flag first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rotateX | No | X rotation in degrees | |
| rotateY | No | Y rotation in degrees | |
| rotateZ | No | Z rotation in degrees | |
| elementId | Yes | Assembly element ID | |
| documentId | Yes | Document ID | |
| instanceId | Yes | Instance ID to transform | |
| translateX | No | X translation. Bare numbers = mm; strings like "10 mm" / "0.5 in" respected. | |
| translateY | No | Y translation. Bare = mm; unit-strings respected. | |
| translateZ | No | Z translation. Bare = mm; unit-strings respected. | |
| workspaceId | Yes | Workspace ID |