参考链接:https://mayastation.typepad.com/maya-station/2010/07/need-to-know-which-polygon-shell-contains-a-given-face-.html
Need to know which polygon shell contains a given face ?
You can use polygon Selection Contraints rules to automatically expand your selection to the entire shell that surrounds your selected component.
My problem with using this method in a script, and then querying the new selection, is that I prefer to avoid changing the current selection in the middle of a script.
Instead I use the following command, which returns the members of a shell from a single faceID: polySelect.
For example, I‘ve combined a couple of polyPlane meshes into a single object, and I want to list all the faces that belong in the shell that contains pTwinPlane.f[139], so I script:
string $myMeshObject = "pTwinPlane";
int $faceID = 139;
string $shellFaces[] = `polySelect -extendToShell $faceID -noSelection -asSelectString $myMeshObject`;
print `ls -flatten $shellFaces`;
This script identifies faces in the shell surrounding f[139] without querying the selected objects, or changing the polygon selection constraint rules. Note: a shell is defined as the shell of poly faces, not the surrounding UV shell.