Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: JamieVJohnson2

 I was afraid there is no easy way for this. I actually don't understand using vectors in inventor and translating from 3dmodel space to  2d sketch space,I always get some kind an error.@JamieVJohnson2 can i trouble you to finish this code with the method you explained in the reply if it is not too much trouble?????

 

 

Dim partDoc As PartDocument 
partDoc = ThisApplication.ActiveDocument

Dim partDef As Inventor.PartComponentDefinition 
partDef = partDoc.ComponentDefinition 

'set a reference to the transient geometry collection.
Dim oTransGeom As TransientGeometry
oTransGeom = ThisApplication.TransientGeometry


' Create a new sketch.
Dim oSketch As PlanarSketch 
oSketch = partDef.Sketches.Add(partDef.WorkPlanes.Item(1), False)

oSketch.Edit

Dim oOriginSketchPoint As SketchPoint = oSketch.AddByProjectingEntity(partDef.WorkPoints.Item(1))
oline = oSketch.SketchLines.AddByTwoPoints(oOriginSketchPoint, ThisApplication.TransientGeometry.CreatePoint2d(- 100, - 100))