How to change absolute tolerance by RhinoSDK?


#1

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


How can I do?


#2

@Vaker,

this should do it.

c.


#3

Hi Clement,

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


#4

@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.


#5

Hi Clement,

It works.
Thanks for your help.


(Dale Fugier) #6

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