I’m trying to set the scale of a detail on a page layout to a specific number, however when I update the scale it doesn’t update the detail’s WorldToPageTransform. The following code should work on a new document with a layout with one detail:
import rhinoscriptsyntax as rs
import scriptcontext as sc
scale = 4 # Change this number to change the scale
page_view =sc.doc.Views.GetPageViews()[0]
detail = page_view.GetDetailViews()[0]
page_view.SetPageAsActive()
print detail.WorldToPageTransform
rs.DetailScale(detail.Id,1,scale)
detail.CommitViewportChanges()
print detail.WorldToPageTransform
When I run this, the first time it returns (the 6.917 number should update to 4):
R0=(6.91720183486238,0,0,568.5), R1=(0,6.91720183486238,0,148.5), R2=(0,0,0,0), R3=(0,0,0,1)
R0=(6.91720183486238,0,0,568.5), R1=(0,6.91720183486238,0,148.5), R2=(0,0,0,0), R3=(0,0,0,1)
If I just rerun the script the number is updated like it should be:
R0=(4,0,0,568.5), R1=(0,4,0,148.5), R2=(0,0,0,0), R3=(0,0,0,1)
R0=(4,0,0,568.5), R1=(0,4,0,148.5), R2=(0,0,0,0), R3=(0,0,0,1)