Read Instance Parameter Value from Revit Component

Hello!

I am trying to retrieve instance parameter value from a Revit component. It seems like I am doing it the right way, but it is not working:



it is definitely a noob question. I have a lot of experience in working with Dynamo and the Revit API with C# and Python, but I am new to Grasshopper. Any help would be appreciated :slight_smile:

I have found a way to retrieve the data:

However, I am just not sure why it didn’t work the other way

There can be multiple Height parameters on an element, such as this door…

If you have a list of common elements you can get 1 via List Item and query for the particular parameter.


R8-RiR-Get-Parameter.gh (8.2 KB)

Well, there really can NOT be multiple Height parameters on a single element :wink:

I used your approach and also got the Height parameter twice:

By the way, do you notice one of the height parameters that appears here has the same ID as the one in your example: 1010300

In my case, the real one is the 347419. Here’s the data obtained through Dynamo:

There is a single Height parameter with the specified Id. Here’s the data also obtained through Revit Lookup:

And finally, here’s the same data taken from the API directly:

So where does this ghost Height parameter come from? Could you please show it to me in your Revit directly, as it definitely does not exist in mine.

EDIT: I obtained the data through the API, using C# directly in Rhino Inside and the result is the same:

That is a tricky business. I don’t know why these aren’t available via Revit Lookup (perhaps related to schedules?)

Its a builtInParameter (has the - in front of the Int)

This door for example has 2, one related to its height when embedded in a curtain wall, neither return the Height.

That’s weird… especially when these parameters are not available in the API. Is it possible that this is a RI thing somehow? Like in my case, the family is a generic model and does not contain the Built-in Height parameter in the family template, so I only have one instance parameter for Height. What is even more weird it does not appear when you access the element parameters through the API and in no other case other than through RI. Curtain wall parameters should also typically have a single Height. I could try getting that parameter through the API, using its Id and investigate :smiley: but I will have time to try this maybe tommorow

If you dig into any Element I think you’ll find BuiltInParameters that won’t show in Inspect or RevitLookup.

1 Like

If you use the ReadOnly Toggle, it usually removes unwanted parameters maybe check that

1 Like

I get it, but if they don’t appear in the context of the Revit API, they should not really exist. It seems to me it is some kind of a bug, related to the specific component :slight_smile:

I tried it, but it now only returns the ‘fake’ Height, so it’s even worse :frowning:

Change the Boolean to “False” since you don’t want the “ReadOnly” one which is usually the extra system parameter (I agree/believe it shouldn’t be showing up), you would want the parameter you can edit which is NOT “ReadOnly”

yeah I got it now:

thx for the info @M.Tarabishy :slight_smile:

anyway it’s still weird and the data keeps being inconsistent with the one from Inspect Element (which is actually identical with the one from the API, as it should be):

This one shows the single Height parameter. I would probably either use that one in the future or write my own C# component for basic retrieval of data. It seems like the standard way of doing this is far too complicated for such a basic task

Have you tried using “Element Parameter” component instead of “Query Element Parameters”?

I usually use “Inspect Element” & “Element Parameter”… didn’t actually use “Query Element Parameters” before.

yeah, Inspect Element seems to work fine, I was just trying to understand what’s wrong with the other one. Inspect Element would probably be a bit too difficult to work with when you need to get data from a more complex family with much more parameters, as you would need to circle through all of them. But it is what it is. I also see it does not show type parameters. A simple component for basic retrieval of a parameter value, either type or instance would really come handy in my opinion :slight_smile:

Hmm… as mentioned there is a component that does exactly that called “Element Parameter”

For Type parameters, you need to connect the Type of the element (you would usually want to Create Set to get unique types)

yeah, I’m just used to getting this data like that :

It’s just not that handy, that’s all. And we already went through discussing the weird results Element Parameter Component returns sometimes. Anyway, It’s more or less clear to me how to approach this task using RI now

Just to be clear… “Element Parameter” doesn’t have “weird” results and provides the same results as “Inspect Element” !

“Query Element Parameter” is the one having the system parameters showing up.

They are 3 different components

wow, please calm down :smiley: isn’t that the Element Parameter component:

and that as well:

Please check the topic in case you already haven’t and there’s no need to be offended or anything, these are just RI components we are discussing :smiley:

Totally not offended just trying to make sure we are on the same page, what you are seeing Null is the value of the parameters you want to input your text as shown below… totally ignore “Query Element Parameter” for now, to achieve what you need, or am I missing something?

And for the door I assume you have it as Type parameter, so you might need to input the Type which contains that parameter? If that’s not what you are after then totally disregard this message xD

In my case it’s still not like in your example

I suppose this really could be an issue with just a few specific system parameters, I don’t know…