Glitch when using SketchLines.AddByTwoPoints

Glitch when using SketchLines.AddByTwoPoints

Anonymous
Not applicable
410 Views
2 Replies
Message 1 of 3

Glitch when using SketchLines.AddByTwoPoints

Anonymous
Not applicable

I snapped up some code for drawing lines in Sketch.

 

Here's the line I am referencing.

 

oSketch.SketchLines.AddByTwoPoints(oTransGeom.CreatePoint2d(0, 0), oTransGeom.CreatePoint2d(4, 0))

 

The glitch is, the coordinates of the points measure metric.

 

The line measures 1.5748031 in.

 

I expected it to measure 4 in.

 

My file is set to inches units.

 

What am I missing here?

 

Thanks

 

=====================================

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

frederic.vandenplas
Collaborator
Collaborator
Accepted solution

While programming, linear dimensions are always in cm, degrees in radians, so you need to multiply 4 with 2.54. as a metric man, i'm happy with that 😃

 

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
0 Likes
Message 3 of 3

bshbsh
Collaborator
Collaborator

@frederic.vandenplas.external wrote:

While programming, linear dimensions are always in cm, degrees in radians, so you need to multiply 4 with 2.54. as a metric man, i'm happy with that 😃

 


i was always wondering why they chose cm instead of a proper SI prefix. just to add another unnecessary conversion. all technical people i know of use mm. i would deffo be more happy with that. cm is only used by tailors and carpenters Smiley Very Happy

0 Likes