I am atta

sHubamyadav016
Enthusiast Enthusiast
302 Views
2 Replies
Message 1 of 3

I am atta

sHubamyadav016
Enthusiast
Enthusiast

I am attaching a drawing i want to make in fusio

0 Likes
303 Views
2 Replies
Replies (2)
Message 2 of 3

kandennti
Mentor
Mentor

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)
0 Likes
Message 3 of 3

sHubamyadav016
Enthusiast
Enthusiast

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 

0 Likes