csykes
(CSykes)
January 22, 2021, 5:14pm
1
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:
Hello,
For a plugIn I’m writing right now I’m relying on the default Hatchpatterns of R6 for some visualization purposes.
I’m getting the hatchpatterns from the Rhinodoc with the
FindName Method.
My problem is, that in a new document, the HatchPatternTable does not get loaded at startup, so FindName always returns null until i go to the optionsPage of the HatchPatterns or actually run the Hatch command.
Is There a way to force Rhino to load its standard HatchPatternTable in the doc?
You ca…
dale
(Dale Fugier)
January 22, 2021, 6:11pm
3
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
csykes
(CSykes)
January 22, 2021, 6:12pm
4
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 .
– Callum
csykes
(CSykes)
January 22, 2021, 6:14pm
5
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
dale
(Dale Fugier)
January 22, 2021, 6:16pm
6
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