
Not applicable
07-04-2018
12:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all
I have some beginner problems with API. I want to select some face and sketch circle 10mm from some edge (or center of this face. centroid?) Then make extrude and rectangular pattern. Issue I have on left side that sketch goes outside of the face
right side
left side
import adsk.core, adsk.fusion, adsk.cam, traceback def run(context): ui = None try: app = adsk.core.Application.get() ui = app.userInterface design = app.activeProduct rootComp = adsk.fusion.Component.cast(design.rootComponent) sketches = rootComp.sketches faceSel = ui.selectEntity('Select a face', 'Faces') if faceSel: selectedFace = adsk.fusion.BRepFace.cast(faceSel.entity) sketch = sketches.add(selectedFace) circles = sketch.sketchCurves.sketchCircles circle1 = circles.addByCenterRadius(adsk.core.Point3D.create(2,1,0),0.5) except: if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Solved! Go to Solution.