Default hatch patterns

I would like to use the AddHatchPatterns python method to add a couple of default hatch patterns when my script is ran. Where does the default hatch pattern file reside?

I’m finding that if the script is ran on a file that is imported, the hatch patterns are not present. I could import a template file with the patterns already defined, but I thought it might be more elegant to import the patterns I need from the pattern file.

Thanks,

Dan

That would be:

C:\Users\<username>\AppData\Roaming\McNeel\Rhinoceros\5.0\Localization\en-US\Support\hatchpatterns.txt

Thanks Mitch.

Strange, I checked a few computers here and we don’t have the hatch pattern file in that location. All we have is colors and printwidths.

I know I created a hatch pattern file for my own custom materials, but I don’t believe I did anything with the default. My custom patten file has a .pat extension, not .txt.

Dan

Hmm, you’re right - mine is the only one here that seems to have one, so maybe I put it there a long time ago… Maybe there isn’t one anymore, and the basic patterns are just stored in the template files…? So maybe you’ll need to import them from there…

–Mitch

If I recall correctly, hatchpatterns.txt was a V4 thing. In V5 hatch pattern definitions are a part of the document, so you can import a *.3dm that has those hatch patterns already in it. You used to be able to import a *.pat file, but trying it through Document Properties ->Annotation -> Hatch import doesn’t seem to work anymore.

Sam

I wonder if that Python method is redundant now? Now that you mention it, I used my hatch pattern definition file to create templates, and I haven’t used it since.

Dan

So I wonder how we go about adding new hatch patterns now?

Actually, I just tried it and it seems to be okay.

Since adding a hatch pattern directly from a “formula” via script doesn’t appear to be exposed in RhinoCommon yet, I guess you could write a temporary .pat file (it’s just simple text) somewhere, import it and then delete the temp file.

–Mitch

Hmm, yeah. It seems to be working in V5, but not in the WIP.