ikaris
10-05-2004, 07:22 PM
Hello everyone,
I recently found this very nice and simple command to convert polygon selections:
polyListComponentConversion
Personally, I prefer to find component conversions without using PolySelectConvert, using polyInfo instead. However, that means I have to write a seperate procedure to extract the component conversions with a tokenize, like this one:
CODE
// Usage: findShared("pPlane1.e[1]", "ef")
// Returns the faces connected to pPlane.e[1]
proc string[] findShared(string $sComp, string $sType)
{
string $szShared[] = eval("polyInfo -" + $sType + " " + $sComp);
string $buffer[];
int $iSize = `tokenize $szShared[0] $buffer`;
clear $szShared;
int $i;
for ($i = 2; $i < $iSize; $i++)
{
if ($buffer[$i] != "Hard")
{
string $szTemp[] = {$buffer[$i]};
$szShared = `stringArrayCatenate $szShared $szTemp`;
}
}
return $szShared;
}
I don't like doing this, and I find that polyListComponentConversion is a much better way...
HOWEVER !
I can't get the return value of polyListComponentConversion to be flattened, there's no flag for it ! So I end up with things like [64:67] and such, which I'd like to break up into individual elements....
Any ideas ?
Thanks !
I recently found this very nice and simple command to convert polygon selections:
polyListComponentConversion
Personally, I prefer to find component conversions without using PolySelectConvert, using polyInfo instead. However, that means I have to write a seperate procedure to extract the component conversions with a tokenize, like this one:
CODE
// Usage: findShared("pPlane1.e[1]", "ef")
// Returns the faces connected to pPlane.e[1]
proc string[] findShared(string $sComp, string $sType)
{
string $szShared[] = eval("polyInfo -" + $sType + " " + $sComp);
string $buffer[];
int $iSize = `tokenize $szShared[0] $buffer`;
clear $szShared;
int $i;
for ($i = 2; $i < $iSize; $i++)
{
if ($buffer[$i] != "Hard")
{
string $szTemp[] = {$buffer[$i]};
$szShared = `stringArrayCatenate $szShared $szTemp`;
}
}
return $szShared;
}
I don't like doing this, and I find that polyListComponentConversion is a much better way...
HOWEVER !
I can't get the return value of polyListComponentConversion to be flattened, there's no flag for it ! So I end up with things like [64:67] and such, which I'd like to break up into individual elements....
Any ideas ?
Thanks !
