ajk48n
10-17-2003, 07:51 PM
I'm trying to create an array of shape nodes from selected objects.
This is what I have so far:
string $curves[] = `ls -sl`;
//string curvesShapes[];
int $i;
for ($i = 0; $i<size($curves); $i++) {
//PROBLEM:$curveShapes[$i] = `pickWalk -d down $curves[$i]`;
$curveShapes = `pickWalk -d down $curves[$i]`;
print $curveShapes;
}
The problem comes when doing the pickWalk. I want curvesShapes to be an array, however when I declare it to be one originally, and run the PROBLEM line, it says that I can't convert a string[] to string.
However, if I let it automatically assign, as in the next line, things seem to work fine. When I type:
print $curveShapes
it gives me a list like I expect. However, all shape nodes that have been inserted into the array are put into $curveShapes[0].
Does anyone know how I can get the pickWalk command to put the objects in separate elements of an array?
This is what I have so far:
string $curves[] = `ls -sl`;
//string curvesShapes[];
int $i;
for ($i = 0; $i<size($curves); $i++) {
//PROBLEM:$curveShapes[$i] = `pickWalk -d down $curves[$i]`;
$curveShapes = `pickWalk -d down $curves[$i]`;
print $curveShapes;
}
The problem comes when doing the pickWalk. I want curvesShapes to be an array, however when I declare it to be one originally, and run the PROBLEM line, it says that I can't convert a string[] to string.
However, if I let it automatically assign, as in the next line, things seem to work fine. When I type:
print $curveShapes
it gives me a list like I expect. However, all shape nodes that have been inserted into the array are put into $curveShapes[0].
Does anyone know how I can get the pickWalk command to put the objects in separate elements of an array?
