How to Cap polysurface

I want to Cap polysurface.I want achieve it by RhinoApp.RunScript()/RhinoApp.RunMenuScript(),call Cap command,how to transfer selceted object. Or is there any other way,Thanks
企业微信截图_16656295413038