Sketch Redefine in part interface to another plane parallel to the initial sketch plane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The same question was asked earlier in this post replied by @ekinsb in 2013
https://forums.autodesk.com/t5/inventor-customization/sketch-redefine/m-p/4412841#M46141
but at that point of time inventor used to remove all the references when a sketch is redefined from one plane to another even though both planes are parallel to each other. But now in inventor 2021 it is possible without losing the references.
I am trying to redefine the hole feature to use a different sketch instead of the current one. i.e. if the hole was made using SKECTH 5, then I need to change that and make the hole to get the points from another sketch SKECTH 6.
Public Sub ChangeHoleSketch()
Dim partDoc As PartDocument
Set partDoc = ThisApplication.ActiveDocument
Dim partComp As PartComponentDefinition
Set partComp = partDoc.ComponentDefinition
If partDoc.SelectSet.Count > 0 Then
If (partDoc.SelectSet.Item(1).Type <> kHoleFeatureObject) Then
MsgBox "Please select Hole feature only."
Exit Sub
Else
Dim hole As HoleFeature
Set hole = partDoc.SelectSet.Item(1)
MsgBox hole.ExtendedName
Dim sk As PlanarSketch
Set sk = hole.Sketch
MsgBox sk.Name
End If
Else
MsgBox "A Hole Feature must be selected first."
Exit Sub
End If
End Sub
The problem is I don't understand a way to proceed further, I can get the base sketch here. But how do I replace it with another sketch ??