Message 1 of 3
I am atta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am attaching a drawing i want to make in fusio
I am attaching a drawing i want to make in fusio
Hi @sHubamyadav016 -San.
I don't understand what it means, but I just created the line.
There seems to be a discrepancy in the numbers.
# Fusion360API Python script
import traceback
import adsk.core as core
import adsk.fusion as fusion
def run(context):
ui: core.UserInterface = None
try:
app: core.Application = core.Application.get()
ui = app.userInterface
des: fusion.Design = app.activeProduct
root: fusion.Component = des.rootComponent
skt: fusion.Sketch = root.sketches.add(
root.xYConstructionPlane
)
coordinates = [
(0,0,0),
(0,158.8,0),
(20,171.7,0),
(20,0,0),
]
create_lines(skt, coordinates)
vp: core.Viewport = app.activeViewport
vp.camera = des.namedViews.topNamedView.camera
vp.fit()
ui.messageBox("Done")
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def create_lines(
skt: fusion.Sketch,
coordinates: list
) -> None:
points = [core.Point3D.create(*c) for c in coordinates]
sktPoints = [skt.sketchPoints.add(p) for p in points]
sktPoints.append(sktPoints[0])
lines: fusion.SketchLines = skt.sketchCurves.sketchLines
for p1, p2 in zip(sktPoints, sktPoints[1:]):
lines.addByTwoPoints(p1, p2)
Thanks for helping I created same drawing now i have one doubt how can I create hole in top face I am attaching drawing for reference