PDA

View Full Version : splitting a vector?



AbstractTech3D
11-11-2012, 07:02 PM
Hello

The following line is correctly outputting the correct value (x value from a vector), but is also producing an error which stops the script at that point:

bb=boundingbox(layer);
xa=bb[1]; // gets first of the 2 returned vectors
info(xa.x);



Is there another way I should be splitting the vector?


Thanks

evenflcw
11-12-2012, 04:13 AM
What do you mean "split the vector"? It seems to me the above code already shows you know how to separate the two vectors in bb aswell as access the individual elements (xyz) of each vector.

The only error that I imagine above lines could produce is if boundingbox() is fed an invalid layer reference/index, from an uninitiated/empty layer.

AbstractTech3D
11-12-2012, 01:07 PM
Yes, I think that was the problem. The code is now working.
Thanks evenflcw

evenflcw
11-12-2012, 04:35 PM
np yw