Bug while trying to zoomExtend a detailView

I’ve got an issue when trying to ZoomExtents a DetailViewObject:
*If I set as active the detailView it seems to work, but as soon as I set back as active the pageView, everything is cancelled.
*Even stanger: If I breack the code with a dummy user action, it works! (for exemple: RhinoGet.GetBool(“PressEnterToContinue”, True, “”, “”, True)

I think this some kind of commit bug, here is my code:

   `Dim CoverSheetpageview As Rhino.Display.RhinoPageView = TryCast(doc.Views.ActiveView, Rhino.Display.RhinoPageView)
        CoverSheetpageview.PageName = "CoverSheet"
        Dim CoverSheetdetailview As Rhino.DocObjects.DetailViewObject = CoverSheetpageview.GetDetailViews(0)
        CoverSheetpageview.SetActiveDetail(CoverSheetdetailview.Id) 'activer le premier détail de la page en cours (a généraliser)
        'Désactiver le détail
        RhinoGet.GetBool("PressEnterToContinue", True, "", "", True)
        doc.Views.ActiveView = CoverSheetpageview

Hi Matthieu.

Here is a viewport example:

Is this helpful?

– Dale

Hi Dale,
Sorry it does not help, maybe I was not clear enought with my issue.

My code to zoom extent in a detailview works fine. The issue is when tring to set back the pageview as active.

When I do this:

doc.Views.ActiveView = CoverSheetpageview

the Zoom extent is not kept!

Do you get the issue?

Thanks for helping


No I am not seeing this.

This seems to work (too):

    Protected Overrides Function RunCommand(ByVal doc As RhinoDoc, ByVal mode As RunMode) As Result

      Dim pageView = TryCast(doc.Views.ActiveView, RhinoPageView)
      If pageView Is Nothing Then
        Return Result.Failure
      End If

      Dim details = pageView.GetDetailViews()
      If details Is Nothing OrElse 0 = details.Length Then
        Return Result.Failure
      End If

      pageView.PageName = "CoverSheet"

      For Each detail As DetailViewObject In details


      Dim tmp As String = Nothing
      RhinoGet.GetString("Press <Enter> to continue", True, tmp)

      doc.Views.ActiveView = pageView

      Return Result.Success

    End Function

@dale, i think i am facing a similar problem with zooming in a detail viewport using Rhino 5 SR12. There clearly is a bug, i am trying to zoom to a bounding box like this:

detail.DetailGeometry.IsProjectionLocked = False
detail.DetailGeometry.SetScale(1.0, scriptcontext.doc.ModelUnitSystem, 1.0, scriptcontext.doc.PageUnitSystem)

It seems that ZoomBoundingBox(bbox) does always zoom to the extents of the document content. If i add a point, very far away from my drawing which is not part of the bounding box i pass to the ZoomBoundingBox method, it zooms so this point is included.

If i select something during above code using rs.Command() and then use ZoomBoundingBoxSelected(), it also includes the point which is not selected and far away. How can i make it zoom the bounding box i passed ?

btw. under which circumstances does ZoomBoundingBox(bbox) return False ?


Hi @clement,

Can you provide me a more complete code sample, that I can run here, that repeats what you are seeing?

– Dale

Hi @Dale,

below is an example doc and script, i am trying to set the detail view projection so that the circle is centered using the bounding box. (RH5 SR12):

Example2.3dm (72.8 KB)
Example2.py (940 Bytes)

Hi @clement,

If the detail is active, this works:

import rhinoscriptsyntax as rs
object_ids = rs.ObjectsByName('Circle')
bbox = rs.BoundingBox(object_ids)

I haven’t had the attention span to figure out why you code isn’t working. So I’ve opened an issue so I can spend some time determining if this a bug or not.


– Dale

1 Like