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.
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…
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)
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.