Bug in rs.AddHatch() if no pattern in file?


#1

Hi, if I make a new document with no template and run a script that adds a hatch, just like the example, then no hatch is made since there are no hatch definitions in the file… so what should I do for it to automatically add “Solid” and use that?

import rhinoscriptsyntax as rs
circle = rs.AddCircle(rs.WorldXYPlane(), 10.0)
if rs.IsHatchPattern("Grid"):
    rs.AddHatch( circle, "Grid" )
else:
    rs.AddHatch( circle, rs.CurrentHatchPattern() )

The problem I guess is that if you run print rs.HatchNames() to an empty file then it returns nothing.


(Dale Fugier) #2

@Holo, I promise I will look at this tomorrow…

– D