Tag Archives: code

Revit – Setting Parameters Values in Macro Programming (with VB.Net)

Back in the old days it was easy to set any parameter value in macro. This was the code I was using in Revit 2014:

This was working for Build-in Parameters, Sheared Parameters and Project Parameters. When I migrated some macros to Revit 2017 this formula wasn’t working any more. After some search I found a solution. Unfortunately for every parameter type it’s different.

Build-in Parameters:

Build-in Parameters can be set by referencing to parameter Definition name.

in VB.Net

in Python for Windows Comments parameter:

Parameter Definition Name one can find using Revit Lookup or in API help.

Example in VB.Net from my amended macro for sheet parameters: Drawn By, Checked By and Sheet Issue Date:

Shared Parameters:

Shared Parameters can be set by referencing their GUID number.

in VB.Net:

in Python in Dynamo it DOESN’T WORK:

Guid Number for Shared Parameters can be found in Shared Parameter file i.e

Code example in VB.Net from my amended macro:

Project Parameters:

Project Parameters can be set by referencing in the formula parameter’s Definition by itself.

in VB.Net:

in Python in Dynamo it DOESN’T WORK:

Is unsubscriptable  with get_Parameter or expects BuiltInParamter.

Any one knows how to make it work in Python in Dynamo?