Changed behavior of "-_New" in Rhino 8

Hi guys,

In Rhino 7 I had this macro behind my New button: ! _-New MyTemplate.3dm
In Rhino 8 this works as well. The only difference is that, if the file is modified, there is no “Save changes to Untitled?” dialog anymore. Instead the question appears in the command line.

Is there a way to use -_New and the save changes dialog?
Or, even better… is there a way to make Rhino open the default template?
I know you can use the “internal defaults” but I want my defaults set in the options.
How to do that?

Thanks, Tobias

Save As Template

-Options
– Rhino Options
—Files > Default Templates

Yes, this has been broken since V8 was in WIP… Someone posted a script which I still use to get the old behavior back:

NoEcho ! _-RunPythonScript (
import rhinoscriptsyntax as rs
import scriptcontext as sc

def OpenTemplate():
    template_name="YourTemplateName.3dm"
    doc_name=rs.DocumentName()
    if not doc_name: doc_name="Untitled"
    if sc.doc.Modified:
        msg="Save changes to {} ?".format(doc_name)
        choice = rs.MessageBox(msg,3)
        if choice==6:
            #Yes - save changes
            rs.Command("_Save") #save file
            rs.Command("_-New {}".format(template_name))
        elif choice==7:
            #No - do not save changes
            rs.Command("_-New _No {}".format(template_name))
    else:
        rs.Command("_-New {}".format(template_name))

OpenTemplate()
)

(change the YourTemplateName above to your own template file name.)

Hi Mitch,

Thanks for your reply. I had already written a script myself to fix it.

I started working in Rhino 8 since last week (yeah I know… if you’d call that a bit stupid unfortunately I would have to agree), so that’s why I discovered this now :sweat_smile:

So there might come some more “late to the party” questions…

greetins, Tobias

Color me confused, but dashed versions of commands are supposed to run without GUI…

What color is confused actually? :winking_face_with_tongue:

Just try the macro in any version prior to V8 with a file that has been modified - the message box comes up. I think it was made that way to have a more in-your-face warning that there are unsaved changes that might be lost if you open a new file with your custom template. A command line message is just less visible.

I believe you (I don’t have access to Rhino anymore).