Hello,
I have an error with node Element.GetParameterValueByName
If I query a family on its level and it is below level 0, I have the following error: (with other parameters it works)
Warning: Element.GetParameterValueByName operation failed.
Can not get the item from the current document! The identifier may not be valid.
I work with models. Is the problem of bonding?
French :
Bonjour,
J’ai une erreur avec le nœud Element.GetParameterValueByName
Si j’interroge une famille sur son niveau et qu’il est en dessous du niveau 0, j’ai l’erreur suivante :(avec d’autres paramètres sa fonctionne)
Avertissement:Element.GetParameterValueByName l’opération a échoué.
Could not obtain element from the current document! The id may not be valid.
Je travaille avec des maquettes liées. Le problème vient-il de la liaison ?
Thank you for your help,
But unfortunately, I do not have too much experience in dynamo to understand the use of the node.
Moreover I can not find an example on its use
OK, I’ll be back on this very soon, it’s not as difficult as it seems, please do some tests in the meantime with the nodes returned by a “Coordinate system” query. Basically, a coordinate system is compound by an origin point and 3 vectors (it’s a cartesian system). So just use a basic family like a table and try some operations on it like scale or transform. A description of those nodes can also be found in the Dynamo Dictionary by searching “Coordinate”…
OK, I replicated the situation and I got the same message and a null value for negative level. But if I query on Host parameter, there’s no problem of this kind.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
if isinstance(IN01],list):
elements = [UnwrapElement(i) for i in IN[0]]
else:
elements = [UnwrapElement(IN[0])]
pvalues = []
for e in elements:
p = e.Parameters
ev = [j.AsElementId() for j in p if j.Definition.Name == IN[1]]
elem = [e.Document.GetElement(id) for id in ev][0]
pvalues.append(elem)
OUT = pvalues
@Alain_Hamel
Minimum of reward for the time given: could you also tell what’s wrong with the node I’ve indicated so that I learn something here? Thanks
I just tested your node, and it works too.
Thank you for the time spent finding a solution.
At first I could not find your node, because I was looking in Clockwork, and not in CHYNAMO (not installed!).
In addition each test lasts 8/10 minutes.
Slow down since I have a lower level.
Very nice, I really appreciate this answer but I can’t upload your screenshots, I’m redirected to a Discourse login page. But no matter, I replicated a similar situation and it’s probably precise enough.