Click or drag to resize
RhinoDocModelDistanceDisplayPrecision Property

[Missing <summary> documentation for "P:Rhino.RhinoDoc.ModelDistanceDisplayPrecision"]

Namespace: Rhino
Assembly: RhinoCommon (in RhinoCommon.dll) Version: 5.1.50000.0 (5.0.20693.0)
Syntax
public int ModelDistanceDisplayPrecision { get; set; }

Property Value

Type: Int32
Examples
using Rhino;
using Rhino.Input.Custom;
using Rhino.Commands;

namespace examples_cs
{
  public class DisplayPrecisionCommand : Command
  {
    public override string EnglishName { get { return "csDisplayPrecision"; } }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      var gi = new GetInteger();
      gi.SetCommandPrompt("New display precision");
      gi.SetDefaultInteger(doc.ModelDistanceDisplayPrecision);
      gi.SetLowerLimit(0, false);
      gi.SetUpperLimit(7, false);
      gi.Get();
      if (gi.CommandResult() != Result.Success)
        return gi.CommandResult();
      var distance_display_precision = gi.Number();

      if (distance_display_precision != doc.ModelDistanceDisplayPrecision)
        doc.ModelDistanceDisplayPrecision = distance_display_precision;

      return Result.Success;
    }
  }
}
from Rhino import *
from Rhino.Input.Custom import *
from Rhino.Commands import *
from scriptcontext import doc
import rhinoscriptsyntax as rs

def RunCommand():
  distance_display_precision = rs.GetInteger("Display precision",
    doc.ModelDistanceDisplayPrecision, 0, 7)
  if distance_display_precision == None: return Result.Nothing

  if distance_display_precision <> doc.ModelDistanceDisplayPrecision:
    doc.ModelDistanceDisplayPrecision = distance_display_precision

  return Result.Success

if __name__ ==  "__main__":
  RunCommand()
See Also