 # Getting Y component from list of points inside a loop

I am trying to get the Y component from list of points inside a for loop but for some reason I am always getting null. I am not sure what is the problem, your help is highly appreciated. @HamzehN Difficult to understand your intent from the information you’ve provided above
The nature of the input (t3/FH,t4/FN) isn’t obvious

@vikram_yadav actually this is part of a long code that I am trying to auto-measure total floors Area of a project and facade Area. everything works fine except this part. when I try to get any of the coordinates (X,Y,Z) form one single point it works just fine (point[i].Y) but when it is a list of points it returns null. All what I am trying to achieve here is to get the Y-coordinate as double for a list of points. I am not sure why it is not working.

sorry I missed to show the inputs. see the image below

@HamzehN Not sure what the issue is. Unable to extract the Y coordinate

Could suggest a work around…

In future, when posting code, it would be helpful if you pasted it as Preformatted text (< / >) like this …

`````` def Opt(t3,t4,iNum)
{
return=[Imperative]
{
t2 = {};
y = {};
x = {};
t1 = {};
point1 = {};

i = 0;
while (i<=iNum)
{
t2[i] = t3 * t4;
y[i] = t2[i];
x[i] = t3;
t1[i] = (0..y[i]..x[i]);
point1[i] = Point.ByCoordinates(0,0,t1[i]);
i = i + 1;
}
return=point1;
}
};``````

@Vikram_Subbaiah thanks for the work around, the issue is this is part of bigger code within the Loop so this work around will not work for me.

And thanks for tip.

@HamzehN This might work for you…

``````def Opt(t3,t4,iNum)
{
return=[Imperative]
{
t2 = {};
y = {};
x = {};
t1 = {};
point1 = {};
n={};

i = 0;
j = 0;
while (i<=iNum)
{
t2[i] = t3 * t4;
y[i] = t2[i];
x[i] = t3;
t1[i] = (0..y[i]..x[i]);
point1[i] = Point.ByCoordinates(0,0,t1[i]);
for (a in point1[i])
{
n[i][j]=a.Y;
j = j+1;
}
j = 0;
i = i + 1;
}
return=n;
}
};``````
1 Like

@Vikram_Subbaiah Top Man!! thanks this is exactly what I need

1 Like