RiR Adding parameters to document - Shared vs Global vs Project parameters

Hello RiR dev team,

I am using rhino inside to try and programmatically add parameters in the document.

I understand that currently the RevitAPI does not support project parameters yet so adding those to the document via RiR won’t be achievable.

However, using the AddParameterKey.ByName component adds a shared parameter to the document. I noticed in the source code that the component has the ParameterType hardcoded to Text (see screenshot), would it be possible to allow for dynamic input here?

ParamKey

Also, there is currently no component to my knowledge that lets the user add global parameters to the document. I did a quick test using ghpython and it seemed to work fine (code and definition attached). Could this feature also be added into rhino inside with dynamic parameter type input? Thanks!

import clr
clr.AddReference('System.Core')
clr.AddReference('RhinoInside.Revit')
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')

from System import Enum, Action

import rhinoscriptsyntax as rs
import Rhino
import RhinoInside
import Grasshopper
from RhinoInside.Revit import Revit, Convert
from Autodesk.Revit import DB

#access the active document object
doc = Revit.ActiveDBDocument


def create_global(doc):
    pType = DB.ParameterType.Text
    DB.GlobalParameter.Create(doc, name, pType)

if runIt:
    Revit.EnqueueAction(Action[DB.Document](create_global))
    a = "Success!"
else:
    a = "Please press runIt"

GlobalParam.gh (5.8 KB)

1 Like

Absolutely! Thanks a lot for the example code. I added an issue related to this so we can add the component. I’m gonna share your python code on Wiki until the component has been created :slight_smile:

1 Like