Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SketchProjectCutEdgesCmd in automatically

1 REPLY 1
Reply
Message 1 of 2
Anonymous
247 Views, 1 Reply

SketchProjectCutEdgesCmd in automatically

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}
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Hi everyone.

This problem is solved by myself.

Solution was Occurence SelectSet before SketchProjectCutEdgesCmd.

Thanks!!!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report