
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to be able to define a custom hatch pattern at runtime. Nothing too complicated, just perpendicular lines but i need to be able to specify the spacing between the lines based on user input.
I see that you can do: hatch.SetHatchPattern(HatchPatternType.CustomDefined, "customHatch");
But I'm not entirely sure how to proceed from there. The only example I have been able to find online is here - https://forums.autodesk.com/t5/net/custom-hatch-pattern-in-code/td-p/6810422
In this example he's writing the hatch data to a .pat file in a specific folder on the hard drive. Is it necessary to write a file to the hard drive if it's a hatch pattern that might only be used once? Or can it be entirely defined in code? And if it does need to be written to the hard drive, in the example linked above he's hard coding the file path based on a specific version of Autocad. How would one get the appropriate path for whatever version of Autocad is currently running rather than specifying a certain version?
Thanks!
Solved! Go to Solution.