Custom user dragging of grips within rhino command

This one is very tricky. It may not make sense for how rhino works, but it makes sense to me and definitely for the UX of how I want this plugin to function.

I have a multitude of problems with the code the way I have it working below. My questions/issues are below the code listing.

    CRhinoGetPoint gp0;
    gp0.SetCommandPrompt(L"Select Pull Origin");
    ON_3dPoint origin = gp0.Point();

    CRhinoGetPoint gp;
    gp.SetCommandPrompt(L"Select Pull Destination");
    gp.DrawLineFromPoint(origin, TRUE);

    if(gp.CommandResult() != CRhinoCommand::success)
      return gp.CommandResult();

    ON_3dPoint pt = gp.Point();
    ON_3dVector v = origin - pt;
    //  return CRhinoCommand::nothing;

    //you've got to be kidding me....
    //ON_Xform trans = ON_Xform::TranslationTransformation(v);
    for(int i = 0; i < translationTarget.Count(); i++)
      //context.m_doc.TransformObject(translationTarget[i], trans, true, true, false);

    auto surfacedObj = dynamic_cast<CRhinoSuperDGrips *>(newObj->m_grips)->NewObject(true);
    if(!context.m_doc.ReplaceObject(CRhinoObjRef(newObj), surfacedObj))
      OutputDebugStringA("there was a problem");

First, is there a way to not make the user laboriously click two points to get my translation, but instead to simply drag the screen in one swoop?

Second, do I really have to update my rhino grip points one by one? translation via TransformObject didn’t work. This isn’t a big deal but… it’s quite cumbersome.

Third, related to the second issue, when I drag the points on the upper left viewport, the Y & Z directions seem to be swapped, likely due to a difference in coordinate systems between grip point and return values from the GetPoint

Moved it the discussion to scripting. Sorry if it’s not 100% right, but better than Uncategorized.

Crap. I posted without the rhino developer tag. Please move to rhino developer (c++, not scripting)

Hold up, I just found gumball dragger here (

Edit 2: Used gumball example from and was able to get it going.

Other two questions remain though

Turns out the XZ swap was a viewport issue on my end (i’m an idiot)

I’ll continue to play around with CRhinoGumball, CRhinoGumballDisplayConduit, & CRhinoGumballDragger on my own and formulate better questions next week.