- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am wanting to use iLogic to create a new sketch in a part and and project the sketch entities of a feature into this new sketch. For example, say I had a part that had a pattern of holes, I want to create a new sketch and project all of the hole edges to this new sketch. I have figured out how to create, name and edit a new sketch but I have only found how to pick an edge to project into this new sketch. What I would like is to be able to reference a feature like a pattern and have the ilogic go thru and project all of the entities from that pattern so if there where 10 holes it would project 10 circles and then if the pattern quantity was either increased or decreased I could run the code again and it would project the new number of circles from the pattern. I'm not a programmer so I fumble thru putting code together to do what I want but I can't seem to find anything about how to project entities from a feature. Can anyone let me know if what I am wanting to do is possible and if so maybe help me with the code. Here is what I have so far.
' a reference to the currently active document.
' This assumes that it is a part document.
Dim oPart As PartDocument
oPart = ThisApplication.ActiveDocument
' a reference to the component definition.
Dim oDef As PartComponentDefinition
oDef = oPart.ComponentDefinition
Dim oSketch As PlanarSketch
oSketch = oDef.Sketches.Add(ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select Face to Place Sketch"))
sketchName = InputBox("Give your new sketch a name", "Sketch Name", "Enter Sketch Name Here")
oSketch.Name = sketchName
oSketch.Edit
oSketch.AddByProjectingEntity(ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeFilter, "Select Edges"))TIA
Solved! Go to Solution.