If node returns wrong List<SOLVED>

hello everyone!
i need to creat a surface to calculate its area,so i created a list of points.
But in sometimes end of list’s point is not needed.
so i tried if function in code block,but the returned list was not expected.

SOLVED
use NUMBER(WITHOUT LIST) in the if function
like this

===============================================

slope_Z =
String.ToNumber(DSCore.String.FromObject(Point.Z(List.GetItemAtIndex(intersect_List,[5]))));
alignment_Z =
String.ToNumber(DSCore.String.FromObject(Point.Z(List.GetItemAtIndex(intersect_List,[6]))));
a = slope_Z-alignment_Z;

remove_Pt = [Imperative]
{
if (slope_Z<alignment_Z){

return List.GetItemAtIndex(intersect_List,[0,1,2,3,4,5]);
}
else{
return intersect_List;
}
};

Amigo @RyouPF buenas. I see that in your script you use the function DSCore.String.FromObject, I tried to analyze your script and it does not seem to affect but I leave you the information maybe it will help you, this week I realized that the node works differently in code block; Jacob from Autodesk has given me the solution apparently you must use: “”+a in code block to work the same as the node, I leave you the link to the post!

thanks for your reply! i’ll try ""+a.
and the problem was solved.
method : if function cant use number under the list.

1 Like