Exporting Hatch Patterns - Building firm's .PAT Library

Exporting Hatch Patterns - Building firm's .PAT Library

rjohnstonBK2JP
Contributor Contributor
2,315 Views
12 Replies
Message 1 of 13

Exporting Hatch Patterns - Building firm's .PAT Library

rjohnstonBK2JP
Contributor
Contributor

I'm working on my firm's hatch pattern library. We're currently at 200+ hatch patterns and our library has grown unwieldy and out of control. I'm parsing down the library to contain somewhere around 100 different hatches. I've deleted the unnecessary ones and now I'd like to export the remaining patterns as .PAT files.

 

I think there's multiple possible solutions, but I'm not sure how to find them.

  • Is there a location where the .rvt's specific pattern files are kept?Not the default Autodesk hatch library, but my specific project's library.
  • Is there a way to view the current projects .PAT file so I can copy and paste the code individually?
  • A possible dynamo script to automate this extraction process?

 

I'll take any solution, even if it'll take some time to extract all the patterns.

 

Side gripe, how has Autodesk not come up with a decent way to manage a hatch pattern library? I think it could operate similar to the material library.

Accepted solutions (3)
2,316 Views
12 Replies
Replies (12)
Message 2 of 13

L.Maas
Mentor
Mentor
Accepted solution

You do not have the orignal PAT files anymore?

 

As Revit is based on a single file for the project the hatches are imported in the project (template) and have no relation to external PAT files.

 

I am not aware of any Dynamo script/nodes for this.

 

What you can do is to create regions and apply the different patterns (if you do it nicely you immediately have a nice presentation of your library).

Then export it to Autocad. It should recognize it as hatch patterns. From there you can edit the hatch and possibly export them (might need some LISP script) from Autocad.

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

0 Likes
Message 3 of 13

ToanDN
Consultant
Consultant
Accepted solution

You can export pat files using pyRevit.

Message 4 of 13

hugha
Collaborator
Collaborator

The HatchKit Fill Manager for Revit can select and export all fills held wthin a Revit project file to an external text file in one operation.  

 

hth,

Hugh Adamson

www.hatchkit.com.au 

 

Message 5 of 13

rjohnstonBK2JP
Contributor
Contributor

@L.Maas wrote:

You do not have the orignal PAT files anymore?

 

As Revit is based on a single file for the project the hatches are imported in the project (template) and have no relation to external PAT files.

 

I am not aware of any Dynamo script/nodes for this.

 

What you can do is to create regions and apply the different patterns (if you do it nicely you immediately have a nice presentation of your library).

Then export it to Autocad. It should recognize it as hatch patterns. From there you can edit the hatch and possibly export them (might need some LISP script) from Autocad.


My firm's library has had it's fair share of BIM Managers. The whole library was in disarray when I got here so I decided it was best to scrap it and do it right.

I'm going to do the hatch pattern array like you said. I knew that was an option but was trying to avoid spending 30 hours on it. Looks like it might be the only way.

Thank you for your help!

0 Likes
Message 6 of 13

rjohnstonBK2JP
Contributor
Contributor

@L.MaasSo here's my dynamo file. I'm realllyyyy close to getting it but it doesn't export the string to a text file! I was able to get the names, units, versions, and the line data. I've used a combination of Crumple & Genius Loci nodes to get this done but it won't write to a text file. Making me think that it's not a string. I attached the dynamo script and a picture of the script

 

rjohnstonBK2JP_0-1663683907138.png

 

0 Likes
Message 7 of 13

rjohnstonBK2JP
Contributor
Contributor

@hugha wrote:

The HatchKit Fill Manager for Revit can select and export all fills held wthin a Revit project file to an external text file in one operation.  


I've looked into this solution and it's not a bad solution. However it's $100 for this software and it's only something I need done once

0 Likes
Message 8 of 13

hugha
Collaborator
Collaborator

I presume you were referring to the complete HatchKit package which does cost just shy of $100 for its Standard Edition.

 

However for the usecase you described all you need is the standalone Hatchkit Fill Manager for Revit available from the  Revit Store for $15 via the link posted above.

 

 

best,

Hugh Adamson

www.hatchkit.com.au

 

 

 

 

 

 

 

 

 

 

0 Likes
Message 9 of 13

rjohnstonBK2JP
Contributor
Contributor

@hugha wrote:

I presume you were referring to the complete HatchKit package which does cost just shy of $100 for its Standard Edition.

 

However for the usecase you described all you need is the standalone Hatchkit Fill Manager for Revit available from the  Revit Store for $15 via the link posted above.

 

Oh nice! I didn't know there was multiple options. For $15 I might just check it out. Unfortunately I spent too much time on this yesterday and have to postpone the hatch pattern project for this week while I work on the other stuff I have going. The $15 spend would have saved me hours...

0 Likes
Message 10 of 13

L.Maas
Mentor
Mentor

He, good start.

 

This should work (I used Revit 2022).

 

LMaas_1-1663688932144.png

Dropped the first pat files as it is <solid fill> which might give issue with file save (otherwise do some string replacement)

Used the GeniusLoci package for PAT export

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

0 Likes
Message 11 of 13

rjohnstonBK2JP
Contributor
Contributor
Accepted solution

@L.Maas wrote:

He, good start.

 

This should work (I used Revit 2022).

 

LMaas_1-1663688932144.png

Dropped the first pat files as it is <solid fill> which might give issue with file save (otherwise do some string replacement)

Used the GeniusLoci package for PAT export


Nice! You got it to work right but did the full export work for you? I was having trouble with the Genius Loci package creating files. It doesn't seem to have a problem overwriting the files if they're already created, but doesn't seem to make the .pat on it's own.

 

I peeked at the python within the Export Pat file node and it's instructed to open the file first and I think that's where it's breaking, but I'm a novice at best. I have a curiosity with thge dynamo/python combo, but haven't gotten all the pieces to click yet.

0 Likes
Message 12 of 13

L.Maas
Mentor
Mentor

I probably have a different version of Dynamo and/or GeniusLoci and I had to replace your export pat file node and pull in the same from the library. It generated the pat files without a problem.

 

Few things to note

-I used directorypath and you used filepath.

-I used lacing on the export PAT file node

LMaas_0-1663690891768.png

Basically Dynamo is Python. So if you do not have a node for a particular task you can create your own node by scripting in python.

Also note that they are switching from python 2 to python 3 So in newer Revit versions (Revit 2023 I think) you can expect soem issue with older scripts and older packages.

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Message 13 of 13

rjohnstonBK2JP
Contributor
Contributor

@L.Maas wrote:

I probably have a different version of Dynamo and/or GeniusLoci and I had to replace your export pat file node and pull in the same from the library. It generated the pat files without a problem.

 

Few things to note

-I used directorypath and you used filepath.

-I used lacing on the export PAT file node


It worked for me! I've been working on practicing Dynamo and I thank you for your help. Looks like I was just missing a couple of pieces to make this thing work. There's just a few pieces of the dynamo language that I need to learn still.

 

I do have a question in the beginning though. You inserted "\\" into the string.concat.

Can you explain this a little further?

Does this turn the filename from downloads\patterntesting >> downloads\patterntesting\  ? I'm confused how adding two backslashes adds a single backslash to the end of the filepath.

 

rjohnstonBK2JP_0-1663772400635.png

 

0 Likes