Dynamo Python Primer
  • Take Dynamo Further 🚀
  • 1 Hello Python 🐍
    • 1.1 Why Should I Learn to Code?
    • 1.2 Python Introduction
    • 1.3 What is IronPython?
  • 2 Seeing The Bigger Picture 🔭
    • 2.1 Context Matters
    • 2.2 What is an API?
    • 2.3 The .NET Framework
    • 2.4 Object-Oriented Programming
  • 3 Getting Started 🛴
    • 3.1 Dynamo's Python Node
    • 3.2 Boilerplate Setup Code
    • 3.3 Basics: Input and Output
    • 3.4 Common Errors
  • 4 Revit-Specific Topics 🏡
    • 4.1 Introduction to Revit's API
    • 4.2 How to Read Revit's API Documentation
    • 4.3 Doc, UIDoc, App, UIApp
    • 4.4 Unwrapping Revit Elements
    • 4.5 The FilteredElementCollector
    • 4.6 Geometry Conversion Methods
    • 4.7 Working With Parameters
      • Family Parameters
      • Global Parameters
      • Project Information Parameters
      • Group Parameters
      • Built-In Parameters
    • 4.8 Working With Transactions
    • 4.9 Opening & Closing External Files
    • 4.10 Prompting UI Selection
    • 4.11 Working With Units
    • 4.12 Built-In Categories
    • 4.13 Family Acrobatics
    • 4.14 Feedback: TaskDialogs
  • 5 Glossary 📚
  • About This Primer 👋
Powered by GitBook
On this page

Was this helpful?

  1. 4 Revit-Specific Topics 🏡
  2. 4.7 Working With Parameters

Group Parameters

It's nice to feel like a part of something bigger 🌍

PreviousProject Information ParametersNextBuilt-In Parameters

Last updated 5 years ago

Was this helpful?

Group Parameters Belong to Groups

In Revit 2018, the developers added a new kind of parameter to the application: the Model Group parameter. When creating a Parameter in the Project Parameters dialog, there was now a category in the Categories list for 'Model Groups'.

FamilyInstance/FamilyType is like Group/GroupType

The introductory section on has already covered the relationship between FamilyInstance and FamilyType objects. This exact relationship appears again with and objects.

Like families, groups have an abstract definition, called a GroupType, which defines all of the elements it contains. Any placed instances of this GroupType in the model are known simply as Groups.

When setting up the parameter in the Project Parameters dialog, there is a toggle to either make it an 'Instance' or a 'Type' parameter - this assigns the parameter to the Group or GroupType depending on which you choose. This also corresponds to the way they are accessed in the Revit API.

Accessing Group Parameters

Any instance parameters can be read directly from a group instance. This can either be collecting using a FilteredElementCollector, or passed as an argument into the Python Script node.

#Boilerplate Code

group = UnwrapElement(IN[0])
parameter = group.LookupParameter("Mark")

The above script outputs a object, which can be queried for its name or value using one of the typical .

Accessing Group Type Parameters

Just like reading a FamilyType's parameters, we first need to get access to the GroupType object. We can either collect all of these using a with the .WhereElementIsElementType() filter applied, or by accessing it from a placed group instance.

#Boilerplate Code

group = UnwrapElement(IN[0])
group_type_id = group.GetTypeId()
group_type = doc.GetElement(group_type_id)

type_parameter = group_type.LookupParameter("Mark")

This gets us a Parameter object and, as above, we would use one of the to then read its value.

Family Parameters
Group
GroupType
unwrapped
Parameter
parameter conversion methods
FilteredElementCollector
parameter conversion methods