Maya MASH duplicate along curve automation script problems

Hey guys I’m writing the script in the title but I’ve run into some issues. The script works once but once other mash networks enter the fray it fails since I don’t know how to indicate which one to use. I can’t find any decent MASH documentation so if anyone knows of a good source where they go in depth on the parameters of MASH functions that would be great.

# Curve replicator

# alter mash network name
#add support for other curves

import MASH.api as mapi
import maya.cmds as cmds

selection = (selection = True);
shapes =  cmds.listRelatives (shapes = True)
succes = 0 (cl = True)

#sort selection
if (len(selection) == 2):
    for shape in shapes:
        if (cmds.objectType(shape, isType = 'bezierCurve')):
            obCurve = selection[shapes.index(shape)]
            succes = succes+1
        elif (cmds.objectType(shape, isType = 'mesh')):
            print selection[shapes.index(shape)]
            ob = cmds.duplicate(selection[shapes.index(shape)], rr = True)
            succes = succes+2
            print 'object selected is not bezier or mesh, quiting'

    if (succes == 3):
        #Create mash network (ob)
        mashNetwork = mapi.Network()
        mashNetwork.createNetwork(name = 'Replicator')
        cmds.connectAttr(obCurve + '.worldSpace[0]', 'MASH1_Curve' + '.inCurves[0]', force=1)
    print 'selection incorrect, stopping...'