# Python Help

**URL:** https://forum.dynamobim.com/t/python-help/17333
**Category:** Uncategorized
**Created:** [December 12, 2017, 8:21pm UTC](https://forum.dynamobim.com/t/python-help/17333 "2017-12-12T20:21:09Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 12, 2017, 8:21pm UTC](https://forum.dynamobim.com/t/python-help/17333/1 "2017-12-12T20:21:09Z")

</div>

I am trying to retrieve parameters using python for some fabrication parts in Revit. I cannot access these parameters through the user interface or dynamo (that I know of) and that is my reasoning for using Python. Please see what is wrong with the script below. It is throwing error that is also posted.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/a/8a723d9ba563df694692afe79102acd8f1cad7b0.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/2/b26ab9cd0651fe045083d722656ca22d6a3e1a7c.png)

I watched the course that was suggested at [[https://www.lynda.com/Dynamo-Studio-tutorials/Dynamo-Revit-Python-Scripting/647661-2.html](https://www.lynda.com/Dynamo-Studio-tutorials/Dynamo-Revit-Python-Scripting/647661-2.html)]. It was great. Thanks.

---

<div class="post-metadata">

### Author: ![ricardoperucci](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@ricardoperucci](https://forum.dynamobim.com/u/ricardoperucci)
#### Post date: [December 12, 2017, 8:23pm UTC](https://forum.dynamobim.com/t/python-help/17333/2 "2017-12-12T20:23:44Z")

</div>

you are trying to use “for” in something that is not a list, is an “FabricationPart” object…

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 12, 2017, 8:35pm UTC](https://forum.dynamobim.com/t/python-help/17333/3 "2017-12-12T20:35:18Z")

</div>

Ok. So I have changed the element’s and got rid of the collector. So now I should have a list.

![image](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/3X/2/c/2c2adc9c154afb0ca0365c3cd122462b47dd41e8.png)  
 ![image](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/3X/0/a/0a88e74f760ab4d989558aaf68b45641fadbaba6.png)

---

<div class="post-metadata">

### Author: ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)
#### Post date: [December 12, 2017, 8:49pm UTC](https://forum.dynamobim.com/t/python-help/17333/4 "2017-12-12T20:49:06Z")

</div>

@coastguard09 Built In Parameters and other API references are case-sensitive, try changing “Fabrication\_Part\_Length” to uppercase so that line 20 is  
`output.append(i.get_Parameter(BuiltInParameter.FABRICATION_PART_LENGTH))`

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 12, 2017, 8:53pm UTC](https://forum.dynamobim.com/t/python-help/17333/5 "2017-12-12T20:53:54Z")

</div>

That did the trick. Unfortunately, The results came back null. That means those parameters are empty?

---

<div class="post-metadata">

### Author: ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)
#### Post date: [December 12, 2017, 9:20pm UTC](https://forum.dynamobim.com/t/python-help/17333/6 "2017-12-12T21:20:33Z")

</div>

Empty parameters show up as blanks, not nulls. In the Instance Properties of the parts you are inputting, do you see Length under the Dimensions parameter group? Its possible the Fabrication Parts you are inputting do not report Length.

Does querying the Size property give you the output you are seeking? (replace line 20 with the following line):

`output.append(i.Size)`

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 12, 2017, 9:28pm UTC](https://forum.dynamobim.com/t/python-help/17333/7 "2017-12-12T21:28:26Z")

</div>

Length does not show up under the dimension parameter group which makes me think that they do not report the length.

When I replaced Line 20 they returned blank.

So is there no way to get to that length then?

---

<div class="post-metadata">

### Author: ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)
#### Post date: [December 12, 2017, 9:44pm UTC](https://forum.dynamobim.com/t/python-help/17333/8 "2017-12-12T21:44:52Z")

</div>

Could you share a screenshot showing the Type Properties of one of the elements? It would help to see what your elements are 🙂 if they do not report length, perhaps there is another dimension parameter that will give you the output you are looking for

---

<div class="post-metadata">

### Author: ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)
#### Post date: [December 13, 2017, 2:06am UTC](https://forum.dynamobim.com/t/python-help/17333/9 "2017-12-13T02:06:59Z")

</div>

Hi @coastguard09

Is this length your trying to extract?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/a/ba7c9547d0d8a7e61bd69780c11fa071ba22c33f.png)

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 13, 2017, 2:24am UTC](https://forum.dynamobim.com/t/python-help/17333/10 "2017-12-13T02:24:32Z")

</div>

That’s the one. Those dims are what I want to get at.

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 13, 2017, 2:46pm UTC](https://forum.dynamobim.com/t/python-help/17333/11 "2017-12-13T14:46:12Z")

</div>

I think you have used the “GetDimension” and “GetDimensionValue” methods. When I use the “GetDimensionValue” method it tells me an arguement is expected.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4e948c3799b335d5cbf5f14a9a32503ddb2fb750.png)

I am still looking for what I need. Just figured i’d give an update.

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 14, 2017, 3:43pm UTC](https://forum.dynamobim.com/t/python-help/17333/12 "2017-12-14T15:43:37Z")

</div>

So I know need to input a “FabricationDimensionDefinition” but do not know where I can find this information. Could anybody point me in the right direction?

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/0/c081fa38191aa5ba97fafb3f1512dc88ac1e2949.png)

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 19, 2017, 3:56pm UTC](https://forum.dynamobim.com/t/python-help/17333/13 "2017-12-19T15:56:01Z")

</div>

I think i am almost there. Any help? ![image](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/3X/d/e/de9e79d5bb1dc3283e0d901d2e364c5031ee6d1a.png)

I have so many outs just to check myself.

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 19, 2017, 5:00pm UTC](https://forum.dynamobim.com/t/python-help/17333/15 "2017-12-19T17:00:31Z")

</div>

[today.dyn](https://forum.dynamobim.com/uploads/short-url/tP7nkEo1IiHpT2yNGwNwC2FBPt.dyn) (2.1 KB)

@erfajo I will do this in the future. I have put the .dyn file on here.

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 19, 2017, 6:38pm UTC](https://forum.dynamobim.com/t/python-help/17333/17 "2017-12-19T18:38:14Z")

</div>

@erfajo I am trying to access fabrication part dimensions. They don’t show up like your normal parameters on a revit element. Yes i can get some of them, but not the ones I want using your proposed method.

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 19, 2017, 7:14pm UTC](https://forum.dynamobim.com/t/python-help/17333/19 "2017-12-19T19:14:42Z")

</div>

If you look at @Kulkul screenshot, that is what I am trying to achieve. I just figured it out though. I am going to mark this as solved and then when I put some finishing touches on it, I will post graph and script.

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [December 20, 2017, 11:51am UTC](https://forum.dynamobim.com/t/python-help/17333/22 "2017-12-20T11:51:22Z")

</div>

There are some fabrication parts that do not provide you the size or length or other such pertinent information. If you have a part based on CID pattern 159 for example. The diameter and length fields do not show anywhere so therefore cannot be scheduled. Now, what you’ve with the scripts and graphs is awesome, so thanks for that.

---

<div class="post-metadata">

### Author: ![coastguard09](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coastguard09](https://forum.dynamobim.com/u/coastguard09)
#### Post date: [April 9, 2018, 3:33pm UTC](https://forum.dynamobim.com/t/python-help/17333/24 "2018-04-09T15:33:55Z")

</div>

There is a new package called “Fabrication API”. It is the solution to what I needed.

---

<div class="post-metadata">

### Author: ![jes.gonzalez](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@jes.gonzalez](https://forum.dynamobim.com/u/jes.gonzalez)
#### Post date: [May 20, 2019, 1:38pm UTC](https://forum.dynamobim.com/t/python-help/17333/25 "2019-05-20T13:38:36Z")

</div>

Quick question, I am running into an issues where all my fabrication pipes,valves,coupling and elbows are being returned with a length. How can i sort have it only return pipe in length and everything else as quantity? any help would be greatly appreciated.
