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?


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

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:
    a = "Success!"
    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