SketchUcation Plugin Store

 

 

[Plugin] file_new.rb Startup, Your Way

[Plugin] file_new.rb Startup, Your Way

Postby MartinRinehart » Tue Nov 10, 2009 8:37 pm

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

3) 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.

Code: Select all
# 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.
MartinRinehart
 
Posts: 762
Joined: Mon Jul 27, 2009 1:13 pm
Name: Martin Rinehart

Re: [Plugin] file_new.rb Startup, Your Way

Postby thomthom » Tue Nov 10, 2009 8:48 pm

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
User avatar
thomthom
Global Moderator
 
Posts: 17544
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] file_new.rb Startup, Your Way

Postby Chris Fullmer » Tue Nov 10, 2009 9:35 pm

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 :bounce:

Chris
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6680
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

Re: [Plugin] file_new.rb Startup, Your Way

Postby thomthom » Tue Nov 10, 2009 9:43 pm

I'm with Martin here. The pencil is usually not the tool I start to use. Select all the way! :ugeek:
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17544
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] file_new.rb Startup, Your Way

Postby RickW » Tue Nov 10, 2009 10:35 pm

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

Chris Fullmer wrote: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
 
Posts: 770
Joined: Fri Nov 16, 2007 6:38 am
Location: Wichita, KS
Name: Rick Wilson

Re: [Plugin] file_new.rb Startup, Your Way

Postby MartinRinehart » Wed Nov 11, 2009 2:15 pm

RickW wrote:
thomthom wrote: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.
MartinRinehart
 
Posts: 762
Joined: Mon Jul 27, 2009 1:13 pm
Name: Martin Rinehart

Re: [Plugin] file_new.rb Startup, Your Way

Postby chrisjk » Wed Jan 27, 2010 8:35 pm

This doesn't seem to work for me on my setup (Mac 10.6 , latest SU Pro). Does the code need updating?
Chris
chrisjk
 
Posts: 278
Joined: Fri Dec 05, 2008 8:16 am
Location: Keston, England
Name: Chris Knight

Re: [Plugin] file_new.rb Startup, Your Way

Postby Chris Fullmer » Wed Jan 27, 2010 8:52 pm

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
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6680
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

Re: [Plugin] file_new.rb Startup, Your Way

Postby chrisjk » Wed Jan 27, 2010 10:54 pm

I am trying to use Rick's code.
Chris
chrisjk
 
Posts: 278
Joined: Fri Dec 05, 2008 8:16 am
Location: Keston, England
Name: Chris Knight

Re: [Plugin] file_new.rb Startup, Your Way

Postby xrok1 » Thu Jan 28, 2010 10:47 pm

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. :D 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!
xrok1
 
Posts: 1966
Joined: Sat Feb 16, 2008 1:53 am
Location: Canada
Name: Rocky

Re: [Plugin] file_new.rb Startup, Your Way

Postby Ruturaj » Fri Jan 29, 2010 9:04 am

Hello MartinRinehart,

Thanks you very much, :thumb:
Thanks,
RuturaJ
Ruturaj
 
Posts: 49
Joined: Mon Feb 16, 2009 1:32 pm
Location: Kolhapur, India
Name: Ruturaj Patil

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Not a Premium Member yet? Check out the great time-limited deal we are offering.

Ad Machine
Robot
 
Posts: 2012



 

Return to Plugins

Who is online

Users browsing this forum: alvinthingy, jar69, storkt, TECHDAVE02, tvmuska, udi2012 and 9 guests