ProjectToCPlane command doesn't run on my C# script


I was developing my command to call “ProjectToCPlane” internally but it never get through the command. Feels like I need some special trick before calling ProjectToCPlane… Can you help me out?

        Rhino.DocObjects.RhinoObject recentObject = doc.Objects.MostRecentObject();
        if (recentObject != null)
            recentObject.Select(true, true);
            //bool result = Rhino.RhinoApp.RunScript("_-ProjectToCPlane Yes", true);
            Rhino.RhinoApp.RunScript("! _-ProjectToCPlane _Pause  _Yes", true);
            //r = Rhino.RhinoApp.ExecuteCommand(RhinoDoc.ActiveDoc, "_-ProjectToCPlane _Yes");

I tried ExecuteCommand, -ReadCommandFile, RunScript and RunScript only showed “_ProjectToCPlane” on prompt but still nothing happens…

While if I type this command(totally same script) manually in Rhino, perfectly works.

Hi @hk1,

Does this help?

– Dale