( target=pickobject() if target!=undefined do ( fn yeye o= ( if o.parent==undefined then return o else ( yeye o.parent ) ) ye=yeye target try(setGroupOpen ye false)catch() gps=for e in selection where e.parent == undefined collect e with undo on ( for g in gps do ( try(setGroupOpen g false)catch() bb=#() maxops.cloneNodes ye cloneType:#instance newNodes:&bb newg for o in bb where o.parent==undefined do ( newg=o exit ) newg.transform=g.transform try(delete g.children)catch() try(delete g)catch() ) ) messagebox "关联完成" title:"关联物体" ) )