- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I created a sketch line with following vba codes. When I measure the length on Inventor, the length is 10x longer than the actual length. (measured 14.142, it should be 1.4142). Anything wrong?
----------------
Sub Test()
Dim app As Application
Dim doc As Document
Set app = ThisApplication
Set doc = app.ActiveDocument
Dim partDef As PartComponentDefinition
Set partDef = doc.ComponentDefinition
Dim sk As PlanarSketch
Set sk = partDef.Sketches.Add(partDef.WorkPlanes(3))
sk.Edit
Dim tg As TransientGeometry
Set tg = app.TransientGeometry
Dim myStart As Point2d
Set myStart = tg.CreatePoint2d(0, 0)
Dim myEnd As Point2d
Set myEnd = tg.CreatePoint2d(1, 1)
Call sk.SketchLines.AddByTwoPoints(myStart, myEnd)
sk.ExitEdit
End Sub
Solved! Go to Solution.