Batch add pattern files?

Does anyone know of a Dynamo package to batch add .pat hatch files?

I’ve been cleaning up my firms hatches and I’d like to add them all to our template. I have a bit over 50 of them now and I can add them manually but I thought I’d take the opportunity to learn some dynamo.

Ultimately I’d like to be able to batch load .pat files and then batch create filled region types for each of them. Is this possible with dynamo? Can someone point me in the right direction?

H @Bren,

I don’t think import .pat hatch files is available in the API. (I searched without luck)

On the other hand it is possible to batch create Filled Region Type and set the Patterns :

1 Like

@Alban_de_Chasteigner

Thanks for the help! That was one of the critical steps I was still working on. Much appreciated.

I’ve done a bunch of research and found some info. An addin called “PyRevit” has a function to do with patterns and has some interesting code on GitHub. There are lots of mentions of creating patterns and using grids to get it done.

Reading their code led me to the “FillPattern Members” section of the Revit API Docs.

Now I’m trying to mash together some of the python I found above into a script in dynamo. Wish me luck!

Hi,

You can’t load .pat file with API but you can create Fill patterns as you have seen.

Zebra package has also some nodes for FillPattern.

1 Like

I know I can’t directly load a .pat file via the API but somehow the plugin HatchKit can accomplish that task. I’m guessing they are reading the info in the .pat file and then feeding it into the fill pattern api functions which are available?

I’ll keep working on it until I get it.

If you are able to create a new fill pattern with the API it shouldn’t be a problem. Pat files are pretty simple text files.

I’m still figuring how to create the pattern via the api. I’m not a programmer and it shows. But I’m making progress.

If anyone has any documentation they could link me to I’d appreciate it.

Hey,

Is this helpful at all?

Cheers,

Mark

The most difficult part is to write the FillGrid node and understand well his inputs (angle, origin, spacing, shift)

The nodes Create FillPattern, SetFillGrid and Create FillPatternElement will be not to difficult to write.

The link above create a .pat file and has some very good ideas for the FillGrid properties.

Update :

For those who have the same problem, I wrote new nodes to create fill patterns and batch load .pat hatch files.

3 Likes