/// <summary> /// Removes a viewport from the list of viewports that this clipping plane clips. /// </summary> /// <param name="viewport">The viewport to remove.</param> /// <param name="commit">Commit the change. When in doubt, set this parameter to true.</param> /// <returns>true if the viewport was removed, false if the viewport was not in the list.</returns> /// <since>6.1</since> public bool RemoveClipViewport(Pixel.Rhino.Display.RhinoViewport viewport, bool commit) { if (null == viewport) { throw new System.ArgumentNullException(nameof(viewport)); } bool rc = false; Pixel.Rhino.Geometry.ClippingPlaneSurface geometry = ClippingPlaneGeometry; if (null != geometry) { rc = geometry.RemoveClipViewportId(viewport.Id); if (rc && commit) { CommitChanges(); } } return(rc); }
/// <summary> /// Get view dependent dimension scale /// </summary> /// <param name="doc"></param> /// <param name="dimstyle"></param> /// <param name="vport"></param> /// <returns></returns> /// <since>6.0</since> public static double GetDimensionScale(RhinoDoc doc, DimensionStyle dimstyle, Pixel.Rhino.Display.RhinoViewport vport) { uint docsn = doc.RuntimeSerialNumber; IntPtr pvport = vport.ConstPointer(); IntPtr pdimstyle = dimstyle.ConstPointer(); double scale = UnsafeNativeMethods.ON_V6_Annotation_GetDimScale(docsn, pdimstyle, pvport); GC.KeepAlive(vport); // GC_KeepAlive: Nov. 1, 2018 GC.KeepAlive(dimstyle); // GC_KeepAlive: Nov. 1, 2018 return(scale); }