Hatches are unavailable until options is opened

As the title states really. In Rhinocommon if I try and get any hatches in the document none of them seem to be loaded in until the Options UI is opened and then they’re available.

Is there a way to silently provoke this loading?

string hatch1Name = HatchPattern.Defaults.Hatch1.Name;
HatchPattern hPatt = Rhino.RhinoDoc.ActiveDoc.HatchPatterns.FindName(hatch1Name);

In this example, hPatt will be null until I’ve opened the Options Dialogue.

– Callum

Hi @csykes,

I had the same problem as you, have a look at this topic, where it got solved:

Hi @csykes,

By default, the document’s hatch pattern table is empty. When you show the hatch UI, the table gets populated with some default patterns.

If you need a hatch pattern, make sure its in the hatch pattern table. If not, add it.

SampleCsHatch.cs

– Dale

Good morning @lando.schumpich,

I saw this post yesterday and could potentially use this solution but I would like to force the loading of the Hatch Table :confused:.

– Callum

Hi @dale,

If I have a document with 100s of hatch patterns in, I have to load every single one in if writing a Plugin? There’s no way to use the existing ones in the document unless that UI was opened?

– Callum

No, just the standard hatch patterns that are built into Rhino. And you only need to add these if they are not already there.

– Dale