Create Hatch Pattern from Selection

revit
#5

After some experimentation, I found a limitation to my graph; patterns were being restricted to a Square Boundary.
This made it impossible to make certain types of patterns repeat properly where the length and height could not be the same. See below:


At one point, I did not think it was possible to fix this, but that problem has been remedied!
Now you can upload a pattern of any Rectangular Boundary!
This solution also provided a way to adjust irregular slopes with more tolerance - at least, depending on the bounds of your sketch.
I also took the opportunity to improve the output of the Slope Tolerance Results.
Now you will only see the specific angles you drew, compared to the corrected versions. That way it is easier to notice how much your hatch pattern will be corrected from the original sketch. The new version of the graph has been uploaded in the very first post.

0 Likes

#6

It seems like the “save as” option for 1.3 is not available. If anybody else knows how to do this, feel free to reply to this post.
franciscusm, when you are able to use the graph, let me know what you think.

0 Likes

#7

Dynamo 2.0 graphs are not compatible with earlier versions.

0 Likes

#8

Thanks John. I suspected that this might be the case, but it is nice to have confirmation.

0 Likes

#9

It seems like the working name “Super Hatch”, as shown in earlier pics of the dynamo player, is already in use by a published AutoCAD addon. In order to avoid any copyright issues, the name has been updated to “Ultra Hatch” instead.

1 Like

#10

For anyone wanting to make a hatch pattern from curved lines, refer to this post:


It is particularly useful if you trying to convert a DWG import from Adobe Illustrator.
All those pesky splines will convert into segments of their straighter counterparts.

0 Likes

#11

If any of you have looked closely at the hatch patterns that result from this graph, you may have noticed how angled lines can tend to produce tiny gaps and intersections where they used to connect. For an explanation of why this happens, well - I will get back to that another day! To be brief, let’s just say that the angle corrections are necessary to produce a hatch pattern that works.
But for those who want a perfect pattern from sloped lines, now the option is available to plot the corrected lines nearby. Then you can just ‘clean them up a bit’. Just be sure not to change the angles of the corrected lines; you’ll also want to use the same Slope Tolerance when you run the graph again on the new selection.

Here’s the gravel pattern the was generated from the cleaned sketch. Just change the extension from .txt to .pat and it should be good to go in Revit.
Gravel -Cleaned.txt (307.3 KB)

0 Likes

#12

Hi @dcmasten1

I am attempting to use your script in player but am receiving an error xmlerror

Is there anything in the script I need to make sure is set correctly? How does the script write to a .txt file? Do I need to create one beforehand?

Thank you!

0 Likes

#13

Hi Kloffredo,

Just to rule these out, are you using Dynamo 2.0 and Revit 2018?
With 2018, you should be able to select the file path from the player interface. If you are using Revit 2017, you’ll need to search for the file path node from inside the graph, towards the end.

On my computer, a new file was created automatically, but only in the default directory. If I changed the path, I would need to create a new text file and change the extension to (.pat). Then I could select it from the input instead.

0 Likes

#14

I am using 2018 and when I load it into Dynamo player it says the script needs attention. When I check out the script, it tells me a few warnings but one is that, the variable list has multiple definitions. I was able to create a hatch in 2017 by doing what you suggested and it worked great. I am confused on how to make the boundary box but I think I can figure that out with enough testing. I know you state somewhere that it can be any line type you just need to specify which one.

Let me know your thoughts and thank you this script is a life saver!

Kyle

0 Likes

#15

Hmmm…
Not sure what is going on with Revit 2018 on your side. Glad you could get it to work though in 2017!
As for boundaries, the script find the bounds of your selection and makes that the boundary.
So if you drew a border and didn’t want to see it in your hatch, just change the border lines to a different type and type that into the node that is titled “Border Line Style”.

0 Likes

#16

Awesome, thank you! What version of 18 are in you? Maybe that is the issue.

0 Likes

#17

I would love to get player working for my other co workers who are not as dynamo savvy. I tried to load the script into another persons dynamo player and got the same xml error. If you end up figuring this out please let me know!

0 Likes

#18

It is Revit 2018.3
I installed it on two separate computers with 16 gigs of ram.
I’ll keep looking into it.
If anyone else has a similar problem or solution, please let us know. Thanks.

0 Likes

#19

This is great. Love it.
Is there some kind of units option in the graph?
Cheers

0 Likes

#20

Which version of Dynamo are you using? The xml error sounds very much like an issue with the graph being made for version 2.0 (json) and you using 1.3.x (xml) :slight_smile: it can also be you have some packages clashing with the default nodes and you need to add e.g. DSCore. to some code blocks :slight_smile:

1 Like

#21

Thank you @Jonathan.Olesen. It was conflicting versions and packages. I uninstalled all the older versions of Dynamo and it worked like a charm.

0 Likes

#22

Hi @bradshales,
Maybe you have found this by now, but just in case, perhaps this is what you were looking for?

If you change the units from “INCH” to “MM”, I wonder how that affects the output. It will still show “IN” in the Slope Tolerance Results, but it will probably mean something else. In any case, this may justify another update for the graph so that the outputs are still useful outside of the imperial world.

Just out of curiosity, I am guessing that when you run Dynamo on a Metric model, that the default units are in Meters?

0 Likes

#23

Awesome! Thanks @Jonathan.Olesen and @kloffredo . It seems like the graph is in working order. I will take the issue off the update list.

1 Like

#24

Hi @dcmasten1

Just one more quick question. I am receiving this error when attempting to create my hatch. Do you know of any ways to correct this error with out changing the scale of the hatch pattern I made? Spacing

0 Likes