Dynamic Gear


I created one script for gear but I want (polyCylinder2.subdivisionsAxis) value in my $subaxis attribute can anybody tell me how to do that.
I have given an attribute for subdivision axis and i want that should be connected to (polyCylinder2.subdivisionsAxis)

$cylinder = polyCylinder -r 1 -h 2 -sx $subaxis -sy 1 -sz 1;
window -title “Gear Creater”;
attrFieldSliderGrp -min -0 -max 50.0 -at ($cylinder[1]+".subdivisionsAxis");

	int $subaxis = 20;

for($i=0; $i<=($subaxis-1); $i++)
select -tgl pCylinder1.f[$i];
selectMode -component ;
polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 0 -thickness 1;
select -cl ;