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

Solved it with a test in ilogic.

 

Still wonder if this is the best way to do it.

I get the direction from line.geometry.direction

This is a unitvector which has length value = 1

I cast it AsVector and then I scale it by 5 and i get 50mm

 

Dim odoc As PartDocument = ThisDoc.Document

Dim osketch As PlanarSketch = odoc.ComponentDefinition.Sketches.Item(1)

Dim line As Inventor.SketchLine = osketch.SketchLines(1)
Dim osel As Inventor.SelectSet = odoc.SelectSet

Dim opoint As Inventor.SketchPoint = line.StartSketchPoint

Dim vec As Inventor.Vector2d = line.Geometry.Direction.AsVector
vec.ScaleBy(5)
Dim tg As TransientGeometry = ThisApplication.TransientGeometry
Dim holepoint2d As Inventor.Point2d = tg.CreatePoint2d(opoint.Geometry.x+vec.X, opoint.Geometry.y+vec.Y)

Dim skpnt As SketchPoint = osketch.SketchPoints.Add(holepoint2d, True)