Hey, guys. I’m a very early learner of MEL, and I’m trying to program a Lego generator. I have managed to make a loop that makes a one-dotted brick and the dot on top, but I do not know how to combine the cube and dot into one object in this loop. My question is how can I select only the objects which I created for the brick, regardless of the name, and without selecting anything else? A possible solution I thought would be to make a “select all” command, but that would select everything else, not just the components of the new brick. Here is the progress of my script so far:
float $dotSeparation = 0.8;
float $height = $dotSeparation*0.4;
float $width = $dotSeparation-0.02;
float $dotHeight = 0.17;
float $dotRadius = 0.24;
int $numDots = 2;
polyCube -w $width -h $height -d $width ;
for ($i = 1; $i < $numDots; ++$i) {
polyCylinder -r $dotRadius -h $dotHeight ;
move -r 0 ($dotHeight/2+$height/2) 0 ;
}
You may notice that I gave the cube some of its dimensions based on the separation of the dots have from each other. That was just to integrate the relationships that the measurements that Lego bricks have into the script.
Remember, I am a very early learner, so please keep in mind that some of the things you may refer to I may not know about. Thank you all in advance, and have a nice day.
