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.
I watched the course that was suggested at [https://www.lynda.com/Dynamo-Studio-tutorials/Dynamo-Revit-Python-Scripting/647661-2.html]. It was great. Thanks.
you are trying to use “for” in something that is not a list, is an “FabricationPart” object…
Ok. So I have changed the element’s and got rid of the collector. So now I should have a list.
@coastguard09 Built In Parameters and other API references are case-sensitive, try changing “Fabrication_Part_Length” to uppercase so that line 20 is
That did the trick. Unfortunately, The results came back null. That means those parameters are empty?
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):
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?
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
Is this length your trying to extract?
That’s the one. Those dims are what I want to get at.
I think you have used the “GetDimension” and “GetDimensionValue” methods. When I use the “GetDimensionValue” method it tells me an arguement is expected.
I am still looking for what I need. Just figured i’d give an update.
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?
I think i am almost there. Any help?
I have so many outs just to check myself.
Please attach the needed files for helping purposes, which involves the .dyn file and a small sample file would that also help. Furthermore, please provide code as text not as an image.
It is time-consuming to reinvent what you have done, so please provide whatever you can to speed up the helping process.
today.dyn (2.1 KB)
@erfajo I will do this in the future. I have put the .dyn file on here.
something like this
today.dyn (4.7 KB)
parts = IN
lengths = 
for part in parts:
OUT = lengths
@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.
which parameters do you want, then it is easiere to help you if that could be described.
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.
I can get fabrication elements length with the code I gave you… so what is missing?
today.dyn (8.6 KB)