Here you go, isn't this pretty much what you want?
Select TWO polygon mesh objects, the FIRST selected it the "cutter" and the SECOND selected object is the one to be "sliced".
One side effect is that both objects have their construction history deleted. other than that, there's next to no error checking, an odd warning at the end about multiple "-ch" flags and it's only been tested on Maya 3. sorry...
works a treat though as a quick test knock-up...
:nathaN
__________________________________
[b]
string $checkSel[]=ls -sl -type transform
;
if (size ($checkSel)!=2) {error "not 2 Objects Selected!!";}
string $cutterObj[0]=ls -sl -hd 1
;
string $slicedObj[0]=ls -sl -tl 1
;
select -r $cutterObj[0] $slicedObj[0] ;
delete -ch ; // avoids orphan transforms
shadingNode -n cutSurf -asShader lambert ;
duplicate -n CUTTER $cutterObj ;
select -r CUTTER ;
hyperShade -assign cutSurf ;
select -r $slicedObj[0] CUTTER ;
duplicate ;
polyBoolOp -op 3 -n partOne ;
delete -ch ;
select -r $slicedObj[0] CUTTER ;
polyBoolOp -op 2 -n partTwo ;
delete -ch ;
hyperShade -objects cutSurf ;
delete ;
polyUnite -n $slicedObj -ch 0 partOne partTwo ;
polyPerformAction "polyMergeVertex -d 0.001 -tx 1 -ch 0" v 0 ;
delete cutSurf ;
selectMode -o ;
[/b]