/// <summary> /// Creates a detail view object that is displayed on this page and adds it to the doc. /// </summary> /// <param name="title">The detail view title.</param> /// <param name="corner0">Corners of the detail view in world coordinates.</param> /// <param name="corner1">Corners of the detail view in world coordinates.</param> /// <param name="initialProjection">The defined initial projection type.</param> /// <returns>Newly created detail view on success. null on error.</returns> /// <example> /// <code source='examples\vbnet\ex_addlayout.vb' lang='vbnet'/> /// <code source='examples\cs\ex_addlayout.cs' lang='cs'/> /// <code source='examples\py\ex_addlayout.py' lang='py'/> /// </example> public Rhino.DocObjects.DetailViewObject AddDetailView(string title, Rhino.Geometry.Point2d corner0, Rhino.Geometry.Point2d corner1, DefinedViewportProjection initialProjection) { IntPtr pThis = NonConstPointer(); IntPtr pDetail = UnsafeNativeMethods.CRhinoPageView_AddDetailView(pThis, corner0, corner1, title, (int)initialProjection); Rhino.DocObjects.DetailViewObject rc = null; if (pDetail != IntPtr.Zero) { uint sn = UnsafeNativeMethods.CRhinoObject_RuntimeSN(pDetail); rc = new Rhino.DocObjects.DetailViewObject(sn); } return(rc); }
/// <summary> /// Creates a detail view object that is displayed on this page and adds it to the doc. /// </summary> /// <param name="title">The detail view title.</param> /// <param name="corner0">Corners of the detail view in world coordinates.</param> /// <param name="corner1">Corners of the detail view in world coordinates.</param> /// <param name="initialProjection">The defined initial projection type.</param> /// <returns>Newly created detail view on success. null on error.</returns> /// <example> /// <code source='examples\vbnet\ex_addlayout.vb' lang='vbnet'/> /// <code source='examples\cs\ex_addlayout.cs' lang='cs'/> /// <code source='examples\py\ex_addlayout.py' lang='py'/> /// </example> public DetailViewObject AddDetailView(string title, Geometry.Point2d corner0, Geometry.Point2d corner1, DefinedViewportProjection initialProjection) { IntPtr ptr_detail = UnsafeNativeMethods.CRhinoPageView_AddDetailView(RuntimeSerialNumber, corner0, corner1, title, (int)initialProjection); DetailViewObject rc = null; if (ptr_detail != IntPtr.Zero) { uint sn = UnsafeNativeMethods.CRhinoObject_RuntimeSN(ptr_detail); rc = new DetailViewObject(sn); } return(rc); }
/// <summary> /// Set viewport to a defined projection. /// </summary> /// <param name="projection">The "standard" projection type.</param> /// <param name="viewName">If not null or empty, the name is set.</param> /// <param name="updateConstructionPlane">If true, the construction plane is set to the viewport plane.</param> /// <returns>true if successful.</returns> public bool SetProjection(DefinedViewportProjection projection, string viewName, bool updateConstructionPlane) { if (projection == DefinedViewportProjection.None) return false; IntPtr pThis = NonConstPointer(); if (string.IsNullOrEmpty(viewName)) viewName = null; return UnsafeNativeMethods.CRhinoViewport_SetProjection(pThis, (int)projection, viewName, updateConstructionPlane); }
/// <summary> /// Creates a detail view object that is displayed on this page and adds it to the doc. /// </summary> /// <param name="title">The detail view title.</param> /// <param name="corner0">Corners of the detail view in world coordinates.</param> /// <param name="corner1">Corners of the detail view in world coordinates.</param> /// <param name="initialProjection">The defined initial projection type.</param> /// <returns>Newly created detail view on success. null on error.</returns> /// <example> /// <code source='examples\vbnet\ex_addlayout.vb' lang='vbnet'/> /// <code source='examples\cs\ex_addlayout.cs' lang='cs'/> /// <code source='examples\py\ex_addlayout.py' lang='py'/> /// </example> public Rhino.DocObjects.DetailViewObject AddDetailView(string title, Rhino.Geometry.Point2d corner0, Rhino.Geometry.Point2d corner1, DefinedViewportProjection initialProjection) { IntPtr pThis = NonConstPointer(); IntPtr pDetail = UnsafeNativeMethods.CRhinoPageView_AddDetailView(pThis, corner0, corner1, title, (int)initialProjection); Rhino.DocObjects.DetailViewObject rc = null; if (pDetail != IntPtr.Zero) { uint sn = UnsafeNativeMethods.CRhinoObject_RuntimeSN(pDetail); rc = new Rhino.DocObjects.DetailViewObject(sn); } return rc; }