• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

[Plugin] file_new.rb Startup, Your Way

Scheduled Pinned Locked Moved Plugins
11 Posts 7 Posters 8.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    MartinRinehart
    last edited by 10 Nov 2009, 19:37

    I don't like the Line tool. I avoid it whenever possible. Naturally, I don't want to see it when I start SU, nor after File/New.

    This Ruby starts My Way. I give the "New File" item in the Plugins menu "N" as keyboard shortcut.

    Customize to make it start Your Way:

    1. You may want to delete the line that opens the Ruby Console.
    2. You may want to choose another tool. Your choices are:

    Arc, Axis, Circle, Dimension, Dolly, Erase, Extrude, FieldOf, Freehand, Line, Measure, Move, Offset, Orbit, Paint, Polygon, PositionCamera, Protractor, PushPull, Rectangle, Rotate, Scale, SectionPlane, Selection, Text, Turn, Walk, Zoom, ZoomWindow

    1. If you know Sketchup Ruby programming, the sky is the limit.

    To install: copy this code, edit as you like, and save into a file named "file_new.rb" in your Plugins directory.

    
    # file_new.rb - start my way!
    # Copyright 2009, Martin Rinehart
    
    # Forbidden; remove copyright notice; use in "how to program ..." material.
    # Permitted; everything else.
    
    require 'sketchup'
    
    def send_actions()
    	Sketchup.file_new() 
    	Sketchup.send_action( 'selectSelectionTool;' )
    end # of send_actions()
    
    unless file_loaded?( "file_new.rb" )
    	UI.menu("Plugins").add_item( 'New File ' ) { send_actions() }
    	send_actions()
    	Sketchup.send_action( 'showRubyPanel;' )
    	file_loaded( "file_new.rb" )
    end
    
    

    Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 10 Nov 2009, 19:48

      You could attach it to the onNewModel event. Think there was a plugin that ensured the Select tool was activated upon opening or creating new models using that event....

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • C Offline
        Chris Fullmer
        last edited by 10 Nov 2009, 20:35

        The line tool is my favorite SU tool, with the eraser a close second, and then select comes in at No.3 I think. 😄

        And yes, someone did write a startup tool script....I don't recall who or what it was called exactly though. I never used it since I love the pencil so much 🎉

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 10 Nov 2009, 20:43

          I'm with Martin here. The pencil is usually not the tool I start to use. Select all the way! 🤓

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • R Offline
            RickW
            last edited by 10 Nov 2009, 21:35

            @thomthom said:

            Think there was a plugin that ensured the Select tool was activated upon opening or creating new models using that event....

            @chris fullmer said:

            And yes, someone did write a startup tool script....I don't recall who or what it was called exactly though.

            Perhaps you were thinking of SelectAtStartup by yours truly 😉

            It used observers to check for SU launch, file load, and new file actions to ensure that the Select tool was the default tool any time the active model changed.

            RickW
            [www.smustard.com](http://www.smustard.com)

            1 Reply Last reply Reply Quote 0
            • M Offline
              MartinRinehart
              last edited by 11 Nov 2009, 13:15

              @rickw said:

              @thomthom said:

              Perhaps you were thinking of SelectAtStartup by yours truly 😉

              Sweet and simple, Rick. Plus, you get model opening, which I missed.

              Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

              1 Reply Last reply Reply Quote 0
              • C Offline
                chrisjk
                last edited by 27 Jan 2010, 19:35

                This doesn't seem to work for me on my setup (Mac 10.6 , latest SU Pro). Does the code need updating?

                Chris

                1 Reply Last reply Reply Quote 0
                • C Offline
                  Chris Fullmer
                  last edited by 27 Jan 2010, 19:52

                  Which are you trying to use? Martin's code or Ricks?

                  Chris

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    chrisjk
                    last edited by 27 Jan 2010, 21:54

                    I am trying to use Rick's code.

                    Chris

                    1 Reply Last reply Reply Quote 0
                    • X Offline
                      xrok1
                      last edited by 28 Jan 2010, 21:47

                      YES! YES! YES! thankyou very much Rick. this has always bugged me since about 9 of 10 times i'm opening an existing model and have no use for the pencil. 😄 and thank you too Martin for bringing the topic up.

                      “There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

                      http://www.Twilightrender.com try it!

                      1 Reply Last reply Reply Quote 0
                      • R Offline
                        Ruturaj
                        last edited by 29 Jan 2010, 08:04

                        Hello MartinRinehart,

                        Thanks you very much, 👍

                        Thanks,
                        RuturaJ

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement