Hi, I'm working on a small script right now for a class that will put cylinders on the point of selected components. Does anyone have anything to isolate it to just 1 object? So if I choose some faces on psphere 1, but want to keep it to psphere1 and not have it include psphere 2 if selected to trap it, what do I do in the For/If command? And if anyone can help plug in a trap so it only works on component selection, that would also be fantastic
global proc circleCut()
{
string $mySelection[] = ls -selection -flatten
;
for ($item in $myselection);
{
if ( "." )
}
string $buffer[] ;
int $numTokens = `tokenize $mySelection[0] "." $buffer` ;
print $buffer
string $currentTool = `currentCtx`;
setToolTo moveSuperContext;
vector $pos = `manipMoveContext -q -position Move`;
string $loc[] = `polyCylinder -radius 1 -height 2 -subdivisionsX 10 -subdivisionsY 1 -subdivisionsZ 1 -axis 0 1 0 -rcp 0 -createUVs 3 -constructionHistory 0 -name "cutter#"`;
move -worldSpace -absolute ($pos.x) ($pos.y) ($pos.z);
string $cylinderCutter[] = `ls -selection`;
setToolTo $currentTool;
select $buffer[0];
select -add $cylinderCutter[0];
normalConstraint -weight 1 -aimVector 0 1 0 -upVector 0 1 0 -worldUpType "scene";
polyPerformBooleanAction 2 o 0;
}