Hi everyone,
I Have tried to assign room finishes parameters to room through dynamo using excel file generated from Revit.
Two problems occurred :
1. Finishes sort order getting changed from excel to revit.
2. Unable to set element parameter of Room name & number.
can anybody help me with this script?
please ![]()
FYI plz go through the attached images, Revit file, & Dynamo script.
Gelöst! Gehe zur Lösung
Gelöst von ToanDN. Gehe zur Lösung
Thank you,
That's true, My Bad.
what about the finishes order.
Like For Example : Room 101 is set have F1, C1, & W1.
values getting shuffled.
Perhaps you have resolved this by now. If not, or for anyone else reading this in the future:
You do not show how you are getting the Rooms from the project. You cannot assume that the list of Rooms that Dynamo obtains are sorted in ascending order by the Number property. Most likely, they are not. If the data being read in from Excel is in ascending order by the Room Number, then you might be able to get this to work if you sort your list of Room objects that way, provided there is Excel data for each Room in your model.
A more robust approach would be to determine the Number of each Room and then match it up the Excel data associated with that room number value.
I am nearing the end of a LinkedIn Learning class on using Python Script nodes in Dynamo, and thought this would be a good opportunity to see if I could apply what I was supposedly learning.
Here is an image of the Dynamo graph I put together to accomplish this task:
All of the nodes are stock Dynamo nodes; nothing from any published package was used. The two nodes at the top left get all of the Rooms in the project. In my test file, I purposely did not create the Rooms in room-number order.
The five nodes at the bottom get the Excel file, converting the File Path to a File object, and then read in the contents of the Excel File, from the Finishes sheet. The data comes into Dynamo as a list of lists, with each sublist containing the data on a row in the Excel file. The List.RestOfItems node removes the first sublist, as that is just the column headers. The test Excel file contents look like this:
It may be possible to get the Number property value of each Room in the list of Rooms generated by the top left nodes, and then match that up with the associated sublist from the Excel file using Dynamo nodes, but that task seemed better suited to a Python loop, and once I was there, it seemed easier to use Python to set the parameter values as well. The latter part can be done with stock Dynamo nodes, in which case the Python Script would need to output a list of lists, each sublist consisting of the Room object and the finish values assigned to that Room in the Excel file. Here is an image of the Python Script:
I chose to output a list of the Rooms. I rebuilt the list in the outer loop, although in hindsight I could just as easily have returned the input list. If you wanted to set the parameters in Dynamo nodes, then the output list would be generated at the end of the if statement in the inner loop, with something like output.append([roomRvt,flr,base,wall,clng]). The get/Set parameter lines would then be deleted.
The attached ZIP file contains the Dynamo graph (created in Dynamo 1.3.2), the test Excel file and two Revit 2018.3 project files. The "01" project file is before the graph was run, and the "02" project file was after the graph was run. Each has 12 rooms on the Level 1 Floor Plan and a Room Schedule in which you can see the effects of running the graph.
Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.