Apply history

Hi everybody,

I am trying to transform an object through a CRhinoDoc::TransformObject call with AddTransformHistory set true, as some descendants in the history depends on this object. I would like to know how to force the history update to the descendants.
Thanks,

G.

Hi @gennaro,

If I create a lofted surface with history and then move one of the input curves using cmdSampleMove.cpp, the surface updates as expected. What am I missing?

– Dale

Thanks Dale,

my problem is that I am doing other actions after the transform. I would like to visualize the transformation before them.
If, for instance, you put a gp.GetPoint(); before the end of the command, you can see that the history is not updated right after the transform. It seems that the history is updated only at the end of the command.
Is there a way to force it?

Hi @gennaro,

You can try this:

CRhinoHistoryManager* pMgr = RhinoHistoryManager();
if (nullptr != pMgr)
  pMgr->UpdateDescendants(context.m_doc);

Note, after calling this, you will need to reacquire pointers or references to effected objects.

Also, there is not support for this if it doesn’t work.

– Dale

Thanks Dale!

It seems to be working. My only concern is, since it is unsupported, if it can have any impact on something else or, in the worst case, it just does not work.