Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Based on Matrix3D.translation documentation:
it "Gets and sets the translation component of the matrix"
but setting it actually resets the matrix to an identify matrix, then sets the translation.
Here is a code block showing this inconsistency:
import adsk.core, adsk.fusion, adsk.cam, traceback, math
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
transform = adsk.core.Matrix3D.create()
transform.setToRotation(math.pi/3, adsk.core.Vector3D.create(0, 1, 0), adsk.core.Point3D.create(0, 0, 0))
ui.messageBox(str(transform.asArray()))
transform.translation = adsk.core.Vector3D.create(20, 20, 20)
ui.messageBox(str(transform.asArray()))
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
The following picture shows the result:
Thanks,
Navid
Website: https://perceptino.com
Solved! Go to Solution.

