I am trying to find a way to merge materials in a template and have them change in things like walls, floors, ceilings, stairs, rails, roofs.
No objects are placed in the templates. I just want to merge some redundant materials into one.
I am trying to find a way to merge materials in a template and have them change in things like walls, floors, ceilings, stairs, rails, roofs.
No objects are placed in the templates. I just want to merge some redundant materials into one.
As far as i know you will need to go to every possible place a material can be stored, change over the material assigned and then delete the material i think.
This is how tools like ideate style manager work I believe (they scan the model first then offer merge/delete options).
Hard to do fast in dynamo for big jobs. Python helps a bit but still likely slow.
Hey Donnia - welcome to the forum!
Bit confused by the question, so let me see if I can sum up the situation some.
You have some element types (in this case Iâll assuming theyâre only walls for the sake of simplicity), each of which has a different version of the same type of material assigned (ie: concrete(5â), concrete(6â), etc.). You want to go into each element types and swap the assigned material to the route one (ie: concrete). Once that is done, youâd like to delete the subsequent materials (concrete(5â), concrete(6â), etc.).
If this is accurate let me know and Iâll see what I can come up with.
It would also help if you could post a Revit model for the base in exploring the data - rebuilding such a data set is a bit time consuming and we might guess wrong in both broad terms (ie: which Revit release) and narrow ones (ie: the way you map materials up to the root material).
Nelson Crazy Materials.rvt (696 KB)
Here is a sample of floors and walls from our projects.
Any help would be appreciated.
I should have answered your other question.
That was a fun little challenge. Another oddity of the Revit API discovered, in that CompoundStructureLayer objects have to have the edited set of layers written back into the object in order to âcommitâ the changes, and that CompoundLayerStructure objects have to have their CompoundStructureLayers set in order to commit the changes.
Oddly enough itâs similar to the API in that you have to hit âokâ twice, once for each edit⌠In any case, lesson learned for me.
Dynamo graph:
Roll Up Materials.dyn (56.8 KB)
I didnât want to go messing with materials in case one of them wants to stay in your larger data set. Mostly this was done as the initial grouping relied on a lot of string manipulations, and those are quite unreliable. You might want to export the material names & Ids to excel, and create the roll-ups there instead of using this method. In any case, all materials remain after you run the graph, but the ârolled upâ materials will be purgable elements so theyâre easy to remove after the fact.
So after youâre done ârolling up the materialsâ in each compound element type to remove the duplicates you should manually review stuff (maybe use Dynamo to draw one of each type and cut a nice big section though the lot of them) to make sure nothing crazy happened, and then purge the unused materials, and finally rename the materials which were (deleting the suffix).
I have just had a bit of time to look at this and I am getting an error out. Letâs start and see if I am doing the right input:
Then I added a few Watch nodes to see what was going on.
You can do what you want to that file. I had just copied and pasted some items with the materials in there.
All the materials have been filtered out, so none proceed onward. My guess is the materials are not in use anywhere in the model, or occur in more obscure places like object styles or family parameters/geometry without parameters.
The materials in that project were only there because of the objects that I placed in there. I did a copy paste from a project started by our template where I added those objects. Then I just pasted them into the project that I sent.
Work your way back from the error to see why no materials pass through the filter IN list. If you are new to dynamo itâs worth learning fundamentals as well, this is a highly complex workflow to do properly (almost impossible to do well in Dynamo).
I can see Jacob has only checked compound elements here. Materials occur in many more places such as loadable families (as parameters and also not as parameters), in object style overrides, phase overrides amongst some more obscure places in Revit. To hunt them all down properly takes a very large set of queries that would probably time out Dynamo on most parge projects.
Maybe look into Ideate Style Manager which can do this and is an app. Yes it is pricey, but the time to rebuild it would probably cost a lot of time as well.
Thank you @GavinCrump for the insight. It is a very large project that we start with. I donât know if you have heard of the Parallax template. It is a template that you subtractive what you donât need so the original template is huge.
I am also going to explore the Guardian software that we do have at Nelson Worldwide. Ideate is not one we have, at this time. I am not sure we can or will. I will explore that some more. It had come up on my research on this topic.
Thanks guys on the effort here.
Donnia
Use just the (
and )
characters and see if that clears it up.
Note that youâd need to run this after the conflicting tools were added, and a second run would look like it did nothing as everything would be caught already.
I have found another tool that is making this too easy. It not only letâs me see all the materials in a list, it letâs me rename one to what I want and then pick others to be merged into that. So I can go get one Concrete jacked up named material, change it to Concrete, then select others to merge into that one. The benefit is that once I set this up I can run it on any projects that had been started with the previous template and clean all those up. By doing the rename of one and then the merge of the others it is setting a hierarchy of processes to run. This is the Guardian add in software.
Yes familiar with Aaronâs team and their template approaches. From what I understand they give a high level of support to their customers. Suggest you contact them as first point in future unless Dynamo is a viable option for workflows as they have a good grasp on the various apps that work with their system.
Weâre generally familiar with Guardian here as well. Whilst some people use it, people here tend to help others under the assumption theyâve probably exhausted their plugin options to some degree, or are keen to find a dynamo based approach. No worries though, hope it works well for the team.