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.
@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))
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):
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
I think you have used the “GetDimension” and “GetDimensionValue” methods. When I use the “GetDimensionValue” method it tells me an arguement is expected.
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?
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.
import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
parts = IN[0]
lengths = []
for part in parts:
lengths.append(part.GetParameterValueByName('Length'))
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.
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.