Hi all, im trying to get the parameter type based on the elements and parameter name.
I had tried to design a design script based on that function but it seems to not work?
The line above [Imperative] is used to test on whats wrong with the script.
Any help is much appreciated
elements[0][0];
ParaName[0][0];
count = DSCore.List.Count(elements);
elements[0].ParameterByName(ParaName[0]);
[Imperative]
{
x = 0;
y = [];
while (x<count)
{
a = 0;
for (ele in elements[x])
{
y[x][a] = ele.ParameterByName(ParaName[x]).ParameterType;
a = a + 1;
}
x = x + 1;
}
return = y;
};
@stillgotme the following works in Python and it should work in your code block
OUT = Revit.Elements.Parameter.ParameterByName(element,param)
Hello
@salvatoredragotta, im still getting null values on the codeblock.
The reason why i dont want to do on nodes is due to the complex list level whereby more data will be added on subsequently.
Also, if i were to use the last line, it will come out with this error
What are you feeding as elements?
Mechanical Equipments (MEP families)
Do i need to use FamilyInstance.GetParameters instead?
The node works also with mech equipment .
Can you post your rvt and dyn files (or a link)?
Unfortunately, i cant share with you the link or dyn file as the other portion contains confidential information about the company im working at. But to give you a better understanding of what is being fed in. i will attached some screenshot of it
But i suspect is something to do with the input list.
Below is the actual code
elements;
ParaName;
count = DSCore.List.Count(elements);
[Imperative]
{
x = 0;
y = [];
z = [];
while (x<count)
{
a = 0;
for (ele in elements[x])
{
z[x][a] = ele.Parameter.ParameterByName(ParaName[x]);
y[x][a] = z[x][a].Parameter.ParameterType;
a = a + 1;
}
x = x + 1;
}
return = y;
};
Don’t jump into imperative functions, and stick with basic design script here. Feed it line by line and then you will find the issue.
If I had to guess, you have a namespace collision issue with multiple custom nodes sharing the parameter namespace, and because you’re calling them in a function you’re missing the error message.
1 Like
@erfajo hello, and yes you are totally off there
@jacob.small you are partially right and i had solved my own issue.
Thanks for the great help guys
Please post your solution for future reference.