Hatch Export

Hallo, i am trying to create a “.pat” file for a hatch.
I have the Hatch as a .dwg and imported in to Revit. But there is no way to export.

I tryed it with a Grasshopper Code: But it says:
“Please provide a valid hatch object.”

Code: ghPython
import Rhino.Geometry as rg

def extract_hatch_details(hatch):
if hatch and hatch.Pattern == “Hatchname”:
pattern = hatch.Pattern
scale = hatch.PatternScale
angle = hatch.PatternAngle
details = “*Hatchname, Custom hatch pattern from Rhino\n”
details += “0, 0,0, {0},{0}, {1},-{1}\n”.format(scale, angle)
return details
return “No suitable hatch named ‘Hatchname’ provided.”

if Input1:
Output1 = extract_hatch_details(Input1)
Output1 = “Please provide a valid hatch object.”

Would be great if someone has an idea for the Code or another way to get the hatch without trying to recreate it.