Bug in Linetype

Linetype.SetSegments says that “Lengths >= 0 are interpreted as a line. Lengths < 0 are interpreted as a space.” but this is not the observed behavior (windows). The actual behavior of this function disregards the sign of the number. Instead, the first number is a line, the second number is a gap, and so on. Not sure if the issue is with the function or the comment.

Upon further investigation, the bugs are definitely with the function. If I set segments to “new List{-0.05, 5.0};” It results in the following. This should be tiny gaps with segments of length 5.0 according to the docs. Instead, it is Gaps of length 5, with tiny segments, and the ends of the lines are all wrong. The results of setting line lengths are completely un predictable:(

@Nick_Drian - seems to work as expected here:

#! python 3
import Rhino
import scriptcontext as sc

segs = [-0.05, 5.0]
linetype = Rhino.DocObjects.Linetype()
linetype.Name = "Nick"
if linetype.SetSegments(segs):
    sc.doc.Linetypes.Add(linetype)

The UI doesn’t show negative values, btw.

– Dale