Message 1 of 3

Not applicable
01-11-2019
07:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I want to create a body on the XY plane and then transform it to final position.
For the rotation I tried to use Matrix3D.setToRotationTo(from, to) method. But I get 'Attribute Error'. Why?
How to use this method?
I guess it creates a transformation matrix from these two vectors. How is the rotation point defined.
I also tried to use Matrix3D.setToAlignCoordinateSystem. But it also raises an error.
Thanks
xapo
Code snippet from my test program. Running code is in attached zip file.
transform = adsk.core.Matrix3D.create() from_vector = adsk.core.Vector3D.create(0, 0, 1) to_vector = adsk.core.Vector3D.create(1, 1, 1) transform.setToRotationTo(from_vector, to_vector)
moveFeats = rootComp.features.moveFeatures moveFeatureInput = moveFeats.createInput(bodies, transform) moveFeats.add(moveFeatureInput)
Solved! Go to Solution.