Message 1 of 2
How can I draw an arc with a constant radius with python?
Not applicable
08-16-2018
04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, fusion 360 community
I'm a beginner at fusion360.
I want to draw an arc with a constant radius by a python script.
So I wrote this script to draw an arc with a central angle of 90 degrees and a radius of 1 cm on XZ plane. However, the results both of them were different as the picture below shows.
What should I do?
#Author-
#Description-
import adsk.core, adsk.fusion, adsk.cam, traceback
def run(context):
ui = None
try:
pi = 3.xxx-xxxxxxxx
app = adsk.core.Application.get()
ui = app.userInterface
product = app.activeProduct
design = adsk.fusion.Design.cast(product)
root = design.rootComponent
sketch = root.sketches.add(root.xZConstructionPlane)
arcs = sketch.sketchCurves.sketchArcs
arcs.addByCenterStartSweep(adsk.core.Point3D.create(0,0,0),adsk.core.Point3D.create(1,0,1),pi/2)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
