DifferenceBetween Rhino 5 & 6 For PageToModelRatio?

I have two plugins—one for Rhino 5 the other for Rhino 6—which use similar code. But when acting on the same file each yields different results for PageToModelRatio. Given detail is an instance of Rhino.DocObjects.DetailViewObject:

double ratio = detail.DetailGeometry.PageToModelRatio

In Rhino 5 ratio will be 0.17891563008952949. In Rhino 6, for the the same detail view from the same file ratio will be 0.031881150585873874.

Is there a difference between the two environments or some property that I need to ensure is set in order to get the same value in both versions?


Hi @trevor.d.reid,

Can you post a file that repeats this behavior?

– Dale

I can try. Do you mean the 3dm file or the plugin source @dale ?

An update: while trying to recreate this in a file that I could share (i.e. without any company specific information) I noticed that this problem does not occur if I run the same code against v5_teacup.3dm from the openNURBS examples. So this does seem to be something peculiar about the specific file(s) that I’m dealing with. I am still working on getting a file that reproduces the error that it’d be okay to share.

For additional context our plugin adds one or more traditional drawings as a tab in the Rhino file, and it and the various points of view (top, left, right, etc) are the detail view objects where we’re observing PageToModelRatio

Hi @trevor.d.reid,

For us to provide any insight, we’ll need a 3dm file that repeats the behavior.


– Dale

This file should reproduce the behavior I described:

Thanks @dale .

Hi @trevor.d.reid,

This simple block of Python code:

import Rhino
import scriptcontext as sc

page_view = sc.doc.Views.ActiveView
if page_view and isinstance(page_view, Rhino.Display.RhinoPageView):
    details = page_view.GetDetailViews()
    if details:
        for detail in details:
            name = detail.Name
            if not name: name = "<none>"
            ratio = detail.DetailGeometry.PageToModelRatio
            print "Name: " + name + ", Ratio: " + str(ratio)

Produces the same out put in Rhino 5 and 6 when run against your test file.

Name: DWG_LEFT, Ratio: 0.125
Name: DWG_ISO, Ratio: 0.0
Name: DWG_TOP, Ratio: 0.125
Name: DWG_FRONT, Ratio: 0.125
Name: DWG_RIGHT, Ratio: 0.125
Name: DWG_REAR, Ratio: 0.125
Name: <none>, Ratio: 0.125

What else do I need to do to reproduce what you are seeing?

– Dale