Wrap/unwrap error?

seems OOTB Parameter.ParameterByName won’t pick built-in-parameter if other parameters w/ same name exist so i use Python instead, but i have wrap/unwrap issue again?!

seems ToDSType() can only be used at element level? in my case, element’s parameters need to be output from Python and input into Dynamo node

OK, it’s not wrap/unwrap issue, it’s object type issue, OOTB Parameter.IsReadOnly node will only accept Revit.Elements.Parameter type, but Python output is Autodesk.Revit.DB.Parameter type, so what’s the difference and how to convert in Python or API?


I’m not entirely sure exactly why, but BIPs don’t have that property.

They seem to be a sub-class of Parameter, and when you get them, you don’t seem to directly have access to the same properties. I thought sub-classes inherited the properties of the upper tiers?

I’m sure someone will explain exactly how this works.

I think you will need to use the BIP to go up a class and then you can get the IsReadOnly from there…

Hopefully this graph explains a bit…



Have you thought about just doing the read only check within your python script?

Utilise " IsReadOnly" which will give you a Bool output.

Hi Brendan, as you can see from my Python, the BIPs don’t have that property? You can query Parameters and return it, but not BIPs… Perhaps I’m doing something wrong :slight_smile:

Once you have a “BuiltInParameter” you have to get the parameter eg “Element.get_parameter()” then you will be able to apply the “IsReadOnly”.

Which is similar to the Node version Mark has indicated.

same error message via your method:
for e in es:
ps = e.Parameters
#builtInParameter =
builtInParameter = None
for p in ps:
definition = p.Definition
name = definition.Name
bip = definition.BuiltInParameter
if name == lookUpParamName and bip != BuiltInParameter.INVALID:
#builtInParameter.append([p, bip])
#builtInParameter = p.ToDSType(true)
builtInParameter = e.get_Parameter(bip)

OUT = builtInParameters

looks like checking read-only within Python is the (only?) way out as mentioned by Brendan_Cassidy, maybe the author of OOTB Parameter.IsReadOnly node can give us a clue (what is Revit.Elements.Parameter comparing to Autodesk.Revit.DB.Parameter?)

The out of the box node will work if you output the correct item out (not a BuiltInParameter) but a parameter( eg output this “e.get_Parameter(bip)” though make sure it is wrapped).

“Revit.Elements.Parameter” is the dynamo equivalent of “Autodesk.Revit.DB.Parameter” and could be classed as the wrapped version of “Autodesk.Revit.DB.Parameter”.

Therefore once you have the item from “e.get_Parameter(bip)” you need to apply a “ToDSType()” to it then it will output a “Dynamo” wrapped version which will work with the OOTB node.

I didnt mean it as the way out but a option as it can be easier to do the thing you are after within the same python script instead of adding more nodes.

as i mentioned early, “ToDSType()” seems not working at parameter