Add Share Parameter Into a Revit Family Dynamo
In this workflow, we are going to discuss how we can add together multiple shared parameters to the Revit family unit with just ane click. Yep with the assistance of Dynamo we can consummate this tedious task within a few seconds. So without further ado allow'due south get to workflow.
Note: The commodity is going to be a bit lengthy then please bear with me.
What all you lot demand earlier jumping to the workflow
- A shared parameter file: Earlier proceeding further make sure yous have a shared parameter file ready.
- DYN_SharedParamTesting: One of the custom packages that you tin install within the Dynamo or download it from dynamo packages website and re-create its content within the Dynamo binder(Let not go into how to how to install a package at this moment nosotros volition leave this topic to be covered in upcoming articles).
three. Spreadsheet Program: If you don't take Excel installed in your system it is fine y'all can employ any other costless plan with like features.
"For this workflow, I volition be using CSV format and so don't stress virtually it if you don't have Excel, another reason for using CSV is sometimes dynamo doesn't accept excel format and returns a warning, to avoid this also I will be using CSV format."
That's it! It's all you demand to get started.
Allow's proceed stepwise:-
- Locate your Shared parameter file and open in any spreadsheet program installed on your system. (To demonstrate this workflow I will exist using WPS office, it'south gratuitous)
- Once you take opened your share parameter file yous will be seeing something similar interface as shown in the prototype beneath. Just focus on 2 things here.
- Parameter Proper name.
- Parameter groups (Not born Group just shared parameter groups). In the below image each parameter name is assigned to a number under the group column these numbers are mapping parameter name to group proper noun (Means while creating shared parameter file which parameter was assigned to which group).
In the above image as y'all tin run into I have 3 parameter groups named, BMG_02_identity data, BMG_O1_project Info, and BMG_03_Revit Custom Content. each group is assigned a number (ane,2 and three- numbers are assigned based on the club of group creation I have created -BMG_01_Project info group afterwards BMG_02_identity Data ).
- I hope the in a higher place point was clear, At present let's create a new spread canvass. In the new spreadsheet add four columns equally shown in the image beneath and paste parameter proper noun and group name in the same order as it was in the original shared parameter file.
Let'south say you desire to add only selected parameters to the family. From here I can delete all the parameters which are not required(Every bit highlighted in blue) from the spreadsheet.
One time parameter proper name and parameter groups are pasted we can add Born groups name and information regarding whether the parameter will be an case parameter or not where Y means parameter volition be an instance parameter whereas Northward means It volition be a type parameter.
- Save this file in CSV format.
- Open Revit family unit file(.rfa) so go to the manage tab and open Dynamo.
Let's deconstruct the Dynamo script:
This script is mainly divided into 3 groups of nodes
- Importing CSV file and Cleaning the Data.
- Sorting CSV information into required Format
- Mapping Built-in groups from CSV with Revit built-in groups.
- OUTPUT
Earlier nosotros get into item let's kickoff see the output node that will give u.s. an idea near what all data will be required and in what format.
In the Image above node shown is the final output node which requires 4 inputs and out of 4 are string values means we just need to give text values to these inputs but the last input requires values in Boolean format (i.e. Truthful and Fake).
Nosotros accept seen the final output node now we take a amend understanding of what kind of data is required so let'south commencement with the dynamo part.
- Importing CSV file and Cleaning the data:-
With the help of nodes shown in the above image, CSV data volition be imported in dynamo and it will look like something similar to the image equally shown beneath.
in the above Information.Import.CSV node, nosotros have kept the transpose value as true so what it did gave me a dissever list for each row in the spreadsheet. Even my first row with columns names. We do not demand the first row for creating shared parameter so we will remove this outset listing with column name from the imported data as shown in the image below.
Afterwards removing the kickoff list but required data will exist in that location. (Run into gif)
- Sorting CSV data into required format:-
After cleaning the imported data we will sort the remaining data. from the above gif as yous tin can see we accept 4 lists remaining, starting with index 0 to index three. In this step, we will simply convert this one large list with sub-listing into single 4 single lists with the help of List.GetItemAtIndex node.
- Mapping Built-in family groups with Imported data:
While creating the CSV file nether the Built-in group column we had not used any specific standards for naming congenital-in group whereas in dynamo(Python or Revit API) these should exist named properly. In this step, nosotros will replace built-in group names with standard names.
Equally it can be seen in the higher up prototype we had used Data and Text while writing the CSV file whereas in Dynamo these should be named PG_DATA and PG_TEXT respectively (PG-Parameter Group). With the functioning shown above, nosotros have replaced those names with the standard proper name without shuffling their order.
Once congenital-in group names are replaced with standard names we need to have just i last step is remaining that is converting our Y and N values into Truthful and False.
for this purpose, we have used a simple == operation which checks each value of X with Y and if X=Y it returns the value True otherwise False (Come across Image below)
At present we have all the data which was requires connecting nodes to the terminal output node and clicking on Run will add together all the desired shared parameter to a family.
Allow's accept a look at family properties and check for the shared parameters (See epitome below)
Beneath is a snapshot of the whole script. (You might need to zoom a little)
I hope you have learned something from this article. Please let me know which workflow you would similar me to write nearly in the next article.
Source: https://www.linkedin.com/pulse/add-shared-parameter-family-dynamo-dinesh-nath-goswami
0 Response to "Add Share Parameter Into a Revit Family Dynamo"
Publicar un comentario