Description

Check the “printscale” document user text value before printng. This is useful to verify that the correct section attributes have been set before printing. The vaSetSectionAttributes sets the “printscale” document user text when it sets section attributes.

Author and license

Script by MLAV.LAND, licensed under the GNU GPL 3 License.

Code

import rhinoscriptsyntax as rs
 
def print_scale_warning():
    print_scale = rs.GetDocumentUserText("printscale")
    if print_scale != None:
        result = rs.MessageBox("The current drawing scale for patterns and lineweights is : " + print_scale + ". Are you sure you would like to export this scale?", title="Warning", buttons=1)
        if result==1:
            rs.Command("_Print", echo=False)
            rs.MessageBox("Printing done! :)", title="Go back to work", buttons=0)
    else:
        result = rs.MessageBox("It seems that no section attributes have been applied in this file. Would you like to continue towards printing?", title="Warning", buttons=1)
        if result==1:
            rs.Command("_Print", echo=False)
            rs.MessageBox("Printing done! :)", title="Go back to work", buttons=0)
 
if __name__ == "__main__":
    print_scale_warning()