Hi Jane,
Maybe you must ask to, are the sketch is difference or same sketch with base feature.
I have 2 difference sample :
1. TestPart1.ipt create from face feature in sheet metal. the result are cut using Cut feature (not extrusion feature)
2. TestPart2.ipt create from Extrude Feature, the result are cut using Extrusion Feature.
But I'm using VBA macro, i cant convert this code to iLogic code.
- already delete "set" in illogic code
- I know issue about CommandManager at illogic code.
- already add at top Line "ThisAppilcation.UserInterfaceManager.UserInteractionDisabled = False", but still showing error

This my example code only run at VBA macro:
Public Sub CreateHole()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
Dim CMDMan As CommandManager
Set CMDMan = ThisApplication.CommandManager
Dim oSketch As Sketch
Set oSketch = CMDMan.Pick(kSketchObjectFilter, "Select Sketch")
Dim oProjLine As SketchLine
For Each oProjLine In oSketch.SketchLines
If oProjLine.Reference = True Then
oProjLine.Construction = True
End If
Next
Dim oProfile As Profile
Set oProfile = oSketch.Profiles.AddForSolid
If oPartDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
Dim oSMCD As SheetMetalComponentDefinition
Set oSMCD = oPartDoc.ComponentDefinition
Dim oSMFeat As SheetMetalFeatures
Set oSMFeat = oSMCD.Features
Dim oCutDef As CutDefinition
Set oCutDef = oSMFeat.CutFeatures.CreateCutDefinition(oProfile)
oCutDef.SetThroughAllExtent (kNegativeExtentDirection)
Dim oCutFeature As CutFeature
Set oCutFeature = oSMFeat.CutFeatures.Add(oCutDef)
Else
Dim oPCD As PartComponentDefinition
Set oPCD = oPartDoc.ComponentDefinition
Dim oFeat As PartFeatures
Set oFeat = oPCD.Features
Dim oExtrudeDef As ExtrudeDefinition
Set oExtrudeDef = oFeat.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kCutOperation)
oExtrudeDef.SetThroughAllExtent kSymmetricExtentDirection
Dim oExtrude As ExtrudeFeature
Set oExtrude = oFeat.ExtrudeFeatures.Add(oExtrudeDef)
End If
End Sub
Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.
Autodesk Inventor Professional Certified 2014