Using Eyeshot and need to add to sketch manager

44 Views Asked by At

The below code will create a basic rectangular shape. I am looking to learn how to add the sketch entities to the sketch manager so that I can edit the sketch later.

I think it is something like this.design1.SketchManager.AddEntities(sketch1) but sketch1 is not of the type that addEntities accepts.

    Dim sk1 As Sketch = New Sketch(Plane.XY)
    Dim origin1 As SketchPoint = sk1.AddOrigin()

    Dim poly As SketchLine() = sk1.AddPolygon(
    New Point2D(0, 0),
    New Point2D(30, 0),
    New Point2D(30, 12),
    New Point2D(0, 12)
    )

    sk1.AddConstraintJoin(poly(0).StartPoint, origin1)
    sk1.AddConstraintHorizontal(poly(0))
    sk1.AddConstraintVertical(poly(1))
    sk1.AddConstraintHorizontal(poly(2))
    sk1.AddConstraintVertical(poly(3))

    Dim sketch1 As SketchEntity = New SketchEntity(sk1)

    Dim ext1 As Brep = sketch1.ExtrudeAsBrep(New Interval(-0.75, 0))(0)
    design1.Entities.Add(ext1, Color.SlateGray)
0

There are 0 best solutions below