How to change absolute tolerance by RhinoSDK?

I want to change absolute tolerance by RhinoSDK.
Not using dialog.


How can I do?

@Vaker,

this should do it.

c.

Hi Clement,

I use C++ Rhino5 SDK.
There is no CRhinoDoc::ModelAbsoluteTolerance().

@Vaker, sorry i thought you are using RhinoCommon. The closest i could find is this example:

I am sure @dale knows a better answer.

c.

Hi Clement,

It works.
Thanks for your help.

This should do the trick:

CRhinoCommand::result CCommandTest::RunCommand(const CRhinoCommandContext& context)
{
  // Copy...
  ON_3dmUnitsAndTolerances model_units = context.m_doc.Properties().ModelUnitsAndTolerances();
  // Modify...
  model_units.m_absolute_tolerance = 0.01;
  // Update...
  context.m_doc.Properties().SetModelUnitsAndTolerances(model_units);
  return CRhinoCommand::success;
}

– Dale