ilogic to project sketch lines of part locations on assembly

ilogic to project sketch lines of part locations on assembly

Dave_m_loomis
Explorer Explorer
235 Views
2 Replies
Message 1 of 3

ilogic to project sketch lines of part locations on assembly

Dave_m_loomis
Explorer
Explorer

Hello all, 

 

Long time user of Inventor and first time posting on a forum for help. Hopefully someone can assist with what will be an enormous time saver for myself & my team.

 

What I need to figure out is, how to sketch the edges of parts in an assembly so we can laser scribe those marks.  This would save a tremendous amount of time with layout and increase accuracy/lower NRC's and rework. 

 

My issue is, I'm not sure how to do it.  All attempts thus far have been unsuccessful.  Below is a photo of a weldment with a large face that has multiple parts located on it.  I'd like to just be able to click on the parts which I want to have their edges projected to the main part without having to go into the parts and manually project the edges. 

 

Any suggestions, posts with this solution or recommendations would be appreciated. I'm not asking for someone to write a full script and do the work for me, just need to know what direction I should go since this falls into what I believe is a grey area.  

 

Dave_m_loomis_0-1732730914321.png

 

Thank you in advance for any assistance you can provide.

0 Likes
Accepted solutions (1)
236 Views
2 Replies
Replies (2)
Message 2 of 3

Michael.Navara
Advisor
Advisor
Accepted solution

For this purpose you can use code similar to this one. It projects just a single edge to single sketch, but it can be easily adapted to your needs.

 

'Gather inputs
Dim sketchFaceProxy As FaceProxy = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Pick a planar face")
Dim edgeToProject As EdgeProxy = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeFilter, "Pick an edge to project")

'Create target sketch
Dim sketchFace As Face = sketchFaceProxy.NativeObject
Dim partDef As PartComponentDefinition = sketchFace.Parent.ComponentDefinition
Dim targetSketch As PlanarSketch = partDef.Sketches.Add(sketchFace)
Dim targetSketchProxy As PlanarSketchProxy
sketchFaceProxy.ContainingOccurrence.CreateGeometryProxy(targetSketch, targetSketchProxy)

'Project edge
Dim projectedEdge As SketchEntity = targetSketchProxy.AddByProjectingEntity(edgeToProject)

 

0 Likes
Message 3 of 3

Dave_m_loomis
Explorer
Explorer

@michael 

 

Thanks so much for the help with this.  I'm almost embarrassed it is just a couple lines of code but hey, it works just as I wanted it to. 

 

Thanks again! 

 

Dave

0 Likes