Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am new to the fusion 360 API and I could not find any examples of how to rotate an ellipse. Here is the code I have so far.
app = adsk.core.Application.get()
ui = app.userInterface
design=app.activeProduct
rootComp=design.rootComponent
sketches=rootComp.sketches
sketch=sketches.add(rootComp.xYConstructionPlane)
sketchEllipse = sketch.sketchCurves.sketchEllipses
#create ellipse
centerPoint = adsk.core.Point3D.create(0,0,0)
vector=adsk.core.Vector3D.create(0,0,0)
majorAxisPoint = adsk.core.Point3D.create(50,0,0)
throughPoint = adsk.core.Point3D.create(0,25,0)
ellipse = sketchEllipse.add(centerPoint, majorAxisPoint, throughPoint)
#rotate
matrix=adsk.core.Matrix3D.create()
matrix.setToRotation(30,vector,centerPoint)
sketch.move(sketch.sketchEllipse,matrix)
fusion is complaining about the sketchellipse which should be castable to sketchentites.
Has anyone done this?
thanks!
Solved! Go to Solution.