I am stuck at an issue wherein I need to apply a certain material to a geometry within a family. Is there no way one can extract / get parameters of a solid within a family and then set values to it ?
I could come up to extracting solids/geometry within a family. But beyond that nothing.
How would you do this manually in the user interface? Youâll need to make Dynamo perform those same steps.
Thatâs what. So I am trying to use Dynamo for it. But I am not able to find a component / node for getting material parameters of geometries within a family. The model is huge - has at least 2800 or so of such model elements. so using Dynamo is the only way out.
How would you do this manually? Might have try to answer last time but I donât see anything in the post.
So what do you want me to send here ? I am a new user so not able to attach files. I am sharing a link to G drive where I have the dyn script.
https://drive.google.com/file/d/1jmYzTHQATD_hMnu9pVwJ4wpoqpJa-FC6/view?usp=sharing
I bumped your trust level so you should be able to attach stuff now.
The question is âwhat are the steps you take to perform this manually?â, so likely a written sequence of steps. Something like this (I am not sure what you want to accomplish so these are likely wrong):
- select the family in the project
- Open the family type dialog box from the properties pallet
- Change the material parameters to the desired value
- Save the family as a new type
- make sure the selected family has the right materials applied
Ok. So are you hinting at using these steps to create dynamo script?
Now one change here.
After opening family , I need to select solids.
Then select material parameter of the solid.
Then apply material to that solid. Do this for all solids within the family.
Then save and load family.
This step for each of the 200 something families.
The problem with dynamo is I am not able to select material parameters of solids. Rather there is no node to do that. So then how do I proceed.
More or less - you need to know what things you need to accomplish to get Dynamo to accomplish them.
Opening the family isnât in the steps I put in. Youâll need to do some background processing which means youâre best off writing this as one Python script (a lot of technical knowledge required) or bulk processing the families after saving them out of the file into their own document. I would go with the later Iâd you rent entirely familiar with Python and the Revit API.
By doing it this way after saving out the family library and removing any families you donât want to edit from the list you can open manually the family document, then launch Dynamo and access parameters of individual form elements instead of the Dynamo geometry conversions (what you get with Element.Geometry and other tools). This should expose the parameters you are after.
Thank you Jacob for the detailed explanation. But I am absolutely unaware of Revit API and modifying or playing with it. My knowledge of Dynamo too comes from Rhino+grasshopper and drawing from similarities between the two. Seems I need to take up a course in Python and API ⌠Or whatever that is to perform this activity.
No need to learn Revit API or Python. Certainly a valuable tool, but not a must yet. Instead try this:
-
In Revit save the families out as a library (built in function in Revit). This will give you all the families in the file as .rfa files, with all parameters which have been added in the project environment. (I recommend doing this periodically for your project anyway so you can keep restorative records and reuse content better).
-
Move or delete any of the rfa files you donât need to edit to a an archive folder. Then open one of the RFA files, and launch Dynamo. You should now be able to edit the family document (including associating materials to the solids). Once here build the graph to edit the one family - something like all elements of category, Element.SetParameterValueByName, and then youâre done.
-
Next save a copy of the families to edit, then install the Dynamo MultiPlayer, and set it to run your graph on all of the families to edit.
-
Once process load all of the families into the project and overwrite the previous version(s) but not the parameter values.
It is important that you export, process, and re-load the families as quickly as possible, as otherwise users might make new types and such. Give it a shot and see how far you get. The good news is that everything you learn will enforce the growth of your skill set in Dynamo and Revit automation.
Oh wow ! Thatâs a real step by step for a dummy like me . Thanks a million Jacob. Let me try this and will let you know how far I get.
90% of the difficulty in building Dynamo graphs is figuring out what the steps need to be.
After that there is certain level of technical skill to build up, and then youâre off to the races.
But the âfiguring the stepsâ is always the hard part.
Yes true. So, as I said my understanding of Dynamo comes from Grasshopper. And some functionalities like multiplayer in dynamo wasnât known to me until you mentioned. So , its been a long time on my wishlist to add Dynamo to my kitty of knowledge.
The figuring out what you mentioned, I was taught that as developing the pseudo code for GH. And yes thatâs the key before one jumps into scripting.