Run 2 commands and add the result to an array


#1

Hello All,

I am running the following command ::
string $names[] = `polyCube -w 1 -h 2 -d 1`;
   			$bismuth[$count] = $names[0];
   			$count++;
   
   
   
When the command is executed, polyCubes are created and their name is captured into an array named [i]names[/i] and all meshes are later added to group using the [i]group[/i] command is added to a group. But, I also want to run the [i]polyBevel [/i]along with the creation of the [i]PolyCube[/i]s and store the end resulting meshes in the group.

If I run

 string $names[] = `polyCube -w 1 -h 2 -d 1`;
  			   string $names[] = `polyBevel -fraction 0.03 -mergeVertexTolerance 0.0001`;
 

It runs the code normally and creates the beveled cubes but doesn’t add them to the group.

Kindly help me with this code.

Thanks!

#2

string $names[] = polyCube -w 1 -h 2 -d 1;
string $names[] = polyBevel -fraction 0.03 -mergeVertexTolerance 0.0001;

The polyBevel function returns the node name from the function, that means the polyBevel node, not the item that it is running on. So you are overwriting the array with the bevel node in line 2.