Home Coding, Scripting, Shaders

Command error adding high_high_suffix to the group?

polycounter lvl 8
Offline / Send Message
Pinned
jayantbhatt007 polycounter lvl 8

Hi this command is not working properly Actually when I run this command it is adding two suffixes to the group like this (polycube_high_high). It should add the only add 1 suffix ( polycube_high). How can I fix it?

 

Command 

 

 
<div><span class="post-color-orange">global proc High()&nbsp; &nbsp;//Final procedure</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">{&nbsp; &nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; high();&nbsp; &nbsp; &nbsp;&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; GrpH();&nbsp;&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; inViewMessage -smg "Think And Done " -pos topCenter -bkc 0x00000000 -fade;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">}</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">//It will add high suffix to an object</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">proc high()</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">{</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; string $sel[] = `ls -sl`;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; int $sSize = size($sel);</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; string $suffix = "_high";</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; for($eo in $sel)</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; if(endString($eo, 5)!="_high")</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; {</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; rename $eo ($eo + $suffix);</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; }&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">//It will group your object</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">proc GrpH()</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">{</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; string $selObjs[] = `ls -sl`;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp; &nbsp; group -name ( $selObjs[0] + "_high" ) $selObjs;&nbsp;</span></div><span class="post-color-orange">
</span><div><span class="post-color-orange">&nbsp;}</span></div>
<p>&nbsp;</p>

 

Replies

Sign In or Register to comment.