Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
Is there a way to get or set a global parameter under a group through the api?
Solved! Go to Solution.
Hi all,
Is there a way to get or set a global parameter under a group through the api?
Solved! Go to Solution.
Dear Sam,
Thank you for your query.
Please look at:
Please let us know how you end up solving this.
Thank you!
Best regards,
Jeremy
Thanks, @jeremytammik for your respond
Let me better explain my question.
When I create a global parameter from the UI I have an option to set the parameter under a group
But from the API, I don't have this option
So my question is, is it possible to get or set this information from the API?
Dear Sam,
Thank you for your appreciation and explanation.
I see the problem.
I have asked the development team for advice.
Best regards,
Jeremy
Dear Sam,
Thank you for your patience.
The development team replied:
It looks as if that currently it is not possible. The method exists internally, but it's not exposed to the public API. We compute an appropriate group when you create a global parameter based on the input ParameterType::Enum datatype.
It would not be a large effort to expose this for the next major release of Revit. However, the managers have to approve this modification first.
Best regards,
Jeremy
Hi
It's interesting but I found that it is actually possible to do it now.
GlobalParameter globalParameter = (GlobalParameter)DbApp.Document.GetElement(paramId);
// get
BuiltInParameterGroup group = globalParameter.GetDefinition().ParameterGroup;
// set
globalParameter.GetDefinition().set_ParameterGroup(BuiltInParameterGroup.PG_VISIBILITY);
Thanks
Dear Sam,
Wow, yes, interesting indeed!
Thank you for letting us know!
Yet once again, the Revit API add-in developer community discovers a possibility that the development team is not aware of.
Best regards,
Jeremy
Dear @SamBerk and @jeremytammik,
How could you access GlobalParameter.GetDefinition().set_ParameterGroup()?
As per my experiment, I had the error highlighted below;
'Autodesk.Revit.DB.InternalDefinition.ParameterGroup.set': cannot explicitly call operator or accessor (CS0571)
I am looking for your kind advice.
Thanks in advance.
Hi there!
Care to take the time to show me how to implement this in my script?
I have about 70 Parameters I need to send to a different parameter group.
Cheers,
Matt