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

Project Information Parameters

These parameters are a bit meta - they're information about the document they're a part of!

PreviousGlobal ParametersNextGroup Parameters

Last updated 5 years ago

Was this helpful?

Introduction

Project Information Parameters are a special category of parameters, which are read in the UI via their own special dialog (Manage<Settings<Project Information). They are created like any other parameter, in the Project Parameters dialog, but they are assigned to the 'Project Information' category.

Typically, this is used to store information such as:

  • The name of your organisation

  • The name of the project

  • The project code/number

Retrieving Project Information Parameters

We first need to retrieve the object using a , like so:

#Boilerplate Code
project_info = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_ProjectInformation).ToElements()
#This returns a list of parameters, but it will only
#ever be 1 item long, so we need to get the first element
#by its index using [0]
project_info = project_info[0]
#Now we can access its ParameterSet, its set of parameters
project_info_parameters = project_info.Parameters
OUT = project_info_parameters

In the example above, we output the Parameter objects from the Python node, however, we can just as easily iterate through each parameter, outputting its name and value.

#Boilerplate Code
project_info = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_ProjectInformation).ToElements()[0]
project_info_parameters = project_info.Parameters

output_list = []
for parameter in project_info_parameters:
    output_list.append([parameter.Definition.Name, parameter.AsString()])
OUT = output_list

Note: The example above will output all values as strings, regardless of their original datatype. It's possible to avoid this by querying the Parameter's StorageType property and using the appropriate conversion method for each type.

ProjectInfo
FilteredElementCollector