Hi everyone,
I trying to use the SketchProjectCutEdgesCmd.
And I want to automatically apply by VBA. but, interactive in Inventor window.
Please help me!!!
in my code, I've used....
{code}
' Set a reference to the component occurrence.
Dim oOcc As ComponentOccurrence
Set oOcc = ThisDocument.ComponentDefinition.Occurrences.Item(1)
' Set a reference to the part component definition.
Dim oCompDef As PartComponentDefinition
Set oCompDef = oPartDoc.ComponentDefinition
' Create a new sketch on plane.
Dim oSketch1 As PlanarSketch
Set oSketch1 = oCompDef.Sketches.Add(oCompDef.WorkPlanes.Item("planenumber1"))
'edit the sketch
oSketch1.Edit
'project cut edges
Dim oDef As ControlDefinition
Set oDef = ThisApplication.CommandManager.ControlDefinitions.Item("SketchProjectCutEdgesCmd")
oDef.Execute
'preselect a progected cut edges entity
ThisApplication.CommandManager.DoPreSelect(oOcc)
'I wont to SketchProjectCutEdgesCmd apply by ComponentOccurrence here
'cancel a project cut edges
ThisApplication.CommandManager.StopActiveCommand
'close sketch
oSketch1.ExitEdit
{/code}