Project 3d Sketch into 2d sketch

Project 3d Sketch into 2d sketch

Anonymous
Not applicable
957 Views
1 Reply
Message 1 of 2

Project 3d Sketch into 2d sketch

Anonymous
Not applicable

I have a 3D spline i'm trying to project into a 2d sketch on the XZ plane. The spline is the only object in the 3d sketch. 

I have found vba api codes that show how to project the center point or an axis but nothing about a sketch object.

Is this possible through the api? I'm coding in VBA.

 

Thanks in advance for any help.

0 Likes
Accepted solutions (1)
958 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

If anyone every looks at this I figured it out and it's super easy.

 

SyntaxEditor Code Snippet

    Dim oSketch As Inventor.PlanarSketch
    oSketch = oPartDef.Sketches.Add(oPartDef.WorkPlanes(2))

    
    ' Project 3D Spline
    Dim oSpline As SketchSpline
    oSpline = oSketch.AddByProjectingEntity(Spline3D)

 

Where Spline3D is the spline created in the 3D sketch. Doing it this way allows you to constrain other 2d sketch objects to the projected spline. 

0 Likes