I have written the following script to set a specific layout as the current view then for each detail in the layout I call the rs.ZoomExtents() command. However I get different results depending on weather or not rs.EnableRedraw() is True or False.
When I set EnableRedraw(False) all of the views on the layout are not set to the proper zoom, but when I commented out rs.EnableRedraw() the script functioned as anticipated. However I am not sure why turning off redraw would have an effect on this.
Any assistance would be greatly appreciated.
Below is my short bit of code as well as images of before and after images with and without redraw enabled.
import scriptcontext import rhinoscriptsyntax as rs LayoutNames=scriptcontext.doc.Views.GetPageViews() Layouts= for name in LayoutNames: Layouts.append(name.PageName) Layout=rs.GetString("Select which layout the block should be place into.",Layouts,Layouts) if rs.IsLayout(Layout)==True: rs.CurrentView(Layout) Details = scriptcontext.doc.Views.ActiveView.GetDetailViews() #rs.EnableRedraw(False) for detail in Details: guid = rs.coerceguid(detail) rs.CurrentDetail("DRAWING",guid) rs.DetailLock(guid,False) rs.ZoomExtents()
Before the script was run:
Script with rs.EnableRedraw(False)
Script with #rs.EnableRedraw(False) commented out
Also, I should note that this is happening with SR 5.8.40128