Error node Element.GetParameterValueByName on level "negative"

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 :
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 ?

Hello Alain, do these levels exist in your host file?

It seems that it is a problem of sharing of coordinates, but I do not find

This could be what you need, please let us know:

With CoordinateSystem.Transform
How to use it ?

It will map one coordinate system into another (I would suggest to try first on a simple object). You will find more information here:

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’ll see.
But why is it Ok with levels above level 0?
A problem of coordinates shared at the time of the binding of the model?

I don’t know personally, you could maybe find some kind of answer here:

I’ll let you know if I find something else…

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.

Hi @Alain_Hamel

Pull your watch node down and show us values from 14-18. It would be better if you could drop your files so that we can have closer look at it. Thanks :slight_smile:

Since I added a level below level 0 the work is longer.
If I change the level setting by another, there is no problem.

Place Attente Elec H V303.dyn (70.5 KB)

I just remembered this Element.Level-Clockwork node from Chynamo, it’s definitely what you need :bulb:

This will get parameters from the linked elements :

import clr

from Autodesk.Revit.DB import*

if isinstance(IN01],list):
	elements = [UnwrapElement(i) for i in IN[0]]
	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]

OUT = pvalues

Merci Mostafa_El_Ayoubi

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.

Here is the correction

1 Like

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. :relaxed:

Like you, since yesterday I am redirected to page to download screenshot