Posts

Showing posts with the label parameters

Overwriting Parameters

To overwrite parameters via the Revit API, we need to get the parameter, then pass it a value of the type it expects. If you don't already have it, I would recommend installing Revit Lookup . This tool is always useful, but for what we're doing here, I'd go so far as to say it's virtually essential. In this example, let's pretend we have a big meeting in Germany, requiring us to change all our room names. We'll start by creating a simple dictionary of the room names we need to change. eng_to_de_roomnames = { "Bedroom": "Schlafzimmer", "Living Room": "Wohnzimmer", "Kitchen": "Kueche" } Then, we'll collect all the rooms in our document and iterate through them. (NOTE: When working iterating through rooms, it's always a good idea to check that the room has a location before trying to do anything to it. This is because when a room is deleted...

Manage Global Parameters

Global Parameters can be renamed, deleted, or added or changed via the Revit API. This is especially useful in office contexts, where it is sometimes necessary to update dozens of parameters across hundreds of files, a task that would take us (or a student) days to finish by hand. Let's say we want to change the global parameters in our office so they match the following: Apple: 10 mm Banana: "Example String" Cherry: Yes We'll start by converting that into a python dictionary: global_parameters_should_be = { "Apple": { "Type": "Length", "Value": 10/304.8 #Revit always works in feet, regardless of your project settings. }, "Banana": { "Type": "String", "Value": "Example String" }, "Cherry": { "Type": "Boolean"...