///<summary> This gets called when when the user runs this command.</summary> public override IRhinoCommand.result RunCommand(IRhinoCommandContext context) { MRhinoGetObject go = new MRhinoGetObject(); go.SetCommandPrompt("Select mesh"); go.SetGeometryFilter(IRhinoGetObject.GEOMETRY_TYPE_FILTER.mesh_object); go.GetObjects(1, 1); if (go.CommandResult() != IRhinoCommand.result.success) return go.CommandResult(); IRhinoMeshObject mesh_object = MRhinoMeshObject.ConstCast(go.Object(0).Object()); if (null == mesh_object) return IRhinoCommand.result.failure; SampleCsColoredMeshConduit conduit = new SampleCsColoredMeshConduit(mesh_object.m_runtime_object_serial_number); conduit.Enable(); context.m_doc.Regen(); MRhinoGetString gs = new MRhinoGetString(); gs.SetCommandPrompt("Press <Enter> to continue"); gs.AcceptNothing(); gs.GetString(); conduit.Disable(); context.m_doc.Regen(); return IRhinoCommand.result.success; }
///<summary> This gets called when when the user runs this command.</summary> public override IRhinoCommand.result RunCommand(IRhinoCommandContext context) { MRhinoGetObject go = new MRhinoGetObject(); go.SetCommandPrompt("Select mesh"); go.SetGeometryFilter(IRhinoGetObject.GEOMETRY_TYPE_FILTER.mesh_object); go.GetObjects(1, 1); if (go.CommandResult() != IRhinoCommand.result.success) { return(go.CommandResult()); } IRhinoMeshObject mesh_object = MRhinoMeshObject.ConstCast(go.Object(0).Object()); if (null == mesh_object) { return(IRhinoCommand.result.failure); } SampleCsColoredMeshConduit conduit = new SampleCsColoredMeshConduit(mesh_object.m_runtime_object_serial_number); conduit.Enable(); context.m_doc.Regen(); MRhinoGetString gs = new MRhinoGetString(); gs.SetCommandPrompt("Press <Enter> to continue"); gs.AcceptNothing(); gs.GetString(); conduit.Disable(); context.m_doc.Regen(); return(IRhinoCommand.result.success); }