Sketch Redifine by selection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I think I just need help with one line. If I uncomment the one line that is commented it works except it obviously puts the sketch on the YZ workplane. Instead I want it to put the sketch on the face that I picked. I tried modifying the line which is below the commented line and I realize that (oFace) is not a valid argument but I think it helps you understand what I am wanting. See below:
Public Sub SketchRedefine()
Dim partDoc As PartDocument
Set partDoc = ThisApplication.ActiveDocument
Dim partDef As PartComponentDefinition
Set partDef = partDoc.ComponentDefinition
Dim sketch As PlanarSketch
Set sketch = partDef.Sketches.Item(1)
Dim oFace As Face
Set oFace = ThisApplication.CommandManager.pick(Inventor.SelectionFilterEnum.kPartFaceFilter, "Select the face")
'sketch.PlanarEntity = partDef.WorkPlanes.Item(1)
sketch.PlanarEntity = partDef.SurfaceBodies(oFace)
ThisApplication.ActiveView.Fit
End Sub