# Get (shared) parameter from structural type using API

**URL:** <https://forum.dynamobim.com/t/get-shared-parameter-from-structural-type-using-api/74439>\
**Category:** Revit\
**Tags:** python\
**Created:** [March 16, 2022, 4:01pm UTC](https://forum.dynamobim.com/t/get-shared-parameter-from-structural-type-using-api/74439 "2022-03-16T16:01:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wouter.hilhorst](https://avatars.discourse-cdn.com/v4/letter/w/779978/32.png) [@wouter.hilhorst](https://forum.dynamobim.com/u/wouter.hilhorst)\
**Post date:** [March 16, 2022, 4:01pm UTC](https://forum.dynamobim.com/t/get-shared-parameter-from-structural-type-using-api/74439/1 "2022-03-16T16:01:14Z")

</div>

Hi,  
I`m trying to read a Type parameter from a revit object (structural framing) using the API. The (shared) parameter I`m trying to read is a dimension concerning the width of a concrete beam. I can find the parameter with the below code. But didn`t manage to get a read of the value. Can anyone help with this?  
Param\_Typ = Vloerrandbalk\_Type.Parameters

for i in Param\_Typ:  
if “OPL\_breedte” in i.Definition.Name: pass

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 16, 2022, 4:07pm UTC](https://forum.dynamobim.com/t/get-shared-parameter-from-structural-type-using-api/74439/2 "2022-03-16T16:07:46Z")

</div>

Once you get the parameter you’re looking for you need to get the associated value using one of the following methods:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/0/20392b37d3f1c40dcade9c205fbf4117aa937d34.png)

---

<div class="post-metadata">

**Author:** ![wouter.hilhorst](https://avatars.discourse-cdn.com/v4/letter/w/779978/32.png) [@wouter.hilhorst](https://forum.dynamobim.com/u/wouter.hilhorst)\
**Post date:** [March 16, 2022, 6:10pm UTC](https://forum.dynamobim.com/t/get-shared-parameter-from-structural-type-using-api/74439/3 "2022-03-16T18:10:35Z")

</div>

Thanks. That solved it.  
To get the type parameter value of the width you need to add .AsDouble() to the parameter. Is there also a method to get the parameter value directly?

> TransactionManager.Instance.EnsureInTransaction(doc)  
> Vloerrandbalk = doc.Create.NewFamilyInstance(Lijn\_Rvt, Ligger\_Rvt, Level\_Rvt, Structure.StructuralType.Beam)  
> TransactionManager.Instance.TransactionTaskDone()  
> Vloerrandbalk\_Type = doc.GetElement(Vloerrandbalk\_Type\_Id)  
> Param\_Typ = Vloerrandbalk\_Type.Parameters  
> for i in Param\_Typ:
> 
> > if “OPL\_breedte” in i.Definition.Name: value = i.AsDouble()\*304.8])

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 16, 2022, 7:01pm UTC](https://forum.dynamobim.com/t/get-shared-parameter-from-structural-type-using-api/74439/4 "2022-03-16T19:01:55Z")

</div>

> [@wouter.hilhorst](#):
>
> Is there also a method to get the parameter value directly?

What do you mean? You get the value directly from the parameter.

---

<div class="post-metadata">

**Author:** ![wouter.hilhorst](https://avatars.discourse-cdn.com/v4/letter/w/779978/32.png) [@wouter.hilhorst](https://forum.dynamobim.com/u/wouter.hilhorst)\
**Post date:** [March 16, 2022, 8:22pm UTC](https://forum.dynamobim.com/t/get-shared-parameter-from-structural-type-using-api/74439/5 "2022-03-16T20:22:29Z")

</div>

I mean that the script first gets a list of all type parameters then looks for the parameter name in the list thats needed and then obtains the value. It seems a bit like a workaround.  
Maybe it is also possible to get the value directly from the parameter without first listing all parameters and looping through the names. I can imagine it could also work like a dictionary.  
I tried the lookup method but that doesnt seem to work.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 16, 2022, 8:34pm UTC](https://forum.dynamobim.com/t/get-shared-parameter-from-structural-type-using-api/74439/6 "2022-03-16T20:34:44Z")

</div>

> [@wouter.hilhorst](#):
>
> I tried the lookup method but that doesnt seem to work.

You tried `LookupParameter()`? That would be the only other option besides `GetParameter()`, which is specific to 2022 and requires the `ForgeTypeId` of the parameter. Parsing the element parameters one by one isn’t bad practice though, it’s relatively light.
