Material surface patterns in Dynamo? Revit/Lumion/Dynamo workflow

Does anyone have a way to get the surface patterns of a material in Dynamo? I found the Materials.GetCutPatterns node from Archi-lab which performs its job perfectly, but what I really want is to get the surface patterns.

The goal is to write a script that overrides all surface patterns of selected materials to a certain parallel line model pattern (used for material UV orientation).

See below for the version with cut patterns. I basically just want to swap that node for surface patterns.

I suppose the follow-up will be: a node to set the surface pattern. Similar to Archi-Labā€™s ā€œMaterials.SetCutPatternā€ but just for surface patterns.

Dudes, I googled harder and found the Genius Loci package, which has the goods I needed. :white_check_mark:

I believe John Pierson tackled this one in his app to convert ceiling grids to model lines so they can be seen in other programs like navisworks.

To my understanding it requires the user to manually recreate the pattern in dynamo or c# by reading the properties of its base pattern (either grid spacing, or the source .pat file). From there given a rotation and origin of the pattern, itā€™s written as an algorithm. I donā€™t think the pattern lines are immediately available to dynamo as geometry.

Edit: maybe Iā€™m mistakenā€¦ time to look into genius loci. Iā€™d suggest showing the node in your solution so other users in future can use it too.

Think for ceiling grid Sparrow have some nodes for thatā€¦

1 Like

psā€¦for some reason it doesnt work for me with curved bounderyā€¦and i can only get it to work on linkā€¦im in 2022 probably it works in older versionā€¦not sureā€¦

Probably @Sean_Fruin knows why

Thank you Gavin and Sovitek both for sharing your thoughts! Ultimately, the GeniusLoci package was the best solution for me.

Iā€™ve attached the .dyn here. Itā€™s quite simple, and not 100% resolved, but very close.

This works with my Photoshop/Revit/Lumion workflow (also attached here as a .pdf). Basically, to set surface UV mapping in Revit, I use surface patterns (specifically model patterns) to visualize a surfaceā€™s orientation and orient as desired.

This little dynamo script reads a materialā€™s ā€˜correctā€™ surface pattern and stores it in an excel file, then overwrites that surface pattern with a ā€œMaterialUVā€ surface pattern that shows the orientation of the UV mapping. Then, thereā€™s a piece of the script that can read the original surface patterns from the excel file and reset them to their intended display.

I hope someone else finds this helpful.
_TEST - Material UV Override.dyn (129.7 KB) edited script so itā€™s basically 100% done for what I need. had to component-ize colors and convert to integers and some other little things.

DO_NOT_EDIT_MaterialContainer.xlsx (8.0 KB)
Tutorial - Revit_Photoshop_Lumion_reduced.pdf (2.9 MB)

2 Likes

I broke the script into 3 parts, just to make it more workable. attached below:

_MR - Material UV - 1 Save.dyn (57.6 KB)
_MR - Material UV - 2 Apply.dyn (40.1 KB)
_MR - Material UV - 3 Restore.dyn (54.2 KB)

We are aware of a couple issues thanks to the community. Update coming ASAP.

2 Likes

Thanks Seanā€¦thats nice