@dan rathbun said:
@gruff said:
Can Ruby Scripts Accept a command line parameter on load?
Nope
@gruff said:
Does Sketchup have command line parameters itself that can load a Ruby Script?
sketchup.exe -RubyStartup script.rb
You many need paths:
Try adding the Sketchup program path to the %PATH% var,
then change working dir to the plugins folder where the script is located.
Not as they 'load' up but as an instance of them is started 'yes' - if you mean like MyTool.new(1,2,3) it's 'yes' just set the initialize method in the class to def initialize(arg0=0,arg1=,arg2=0) etc the =0 sets a default value for the arguments if they are not given.
Obviously methods take accept arguments a lot of the API does that... point.offset(vector, distance) where the Point3d method accepts one or two arguments...
If you want some code to run at startup of Sketchup then place it in a .rb script in Plugins that is auto-loaded and it will run - e.g. startupwithrubyconsole.rb containing the line require 'sketchup.rb';Sketchup.send_action("showRubyPanel:") will open the Ruby Console whenever Sketchup starts - pretty useless but just an example... or Sketchup.send_action("selectSelectionTool:") to change the default initial tool from the draw-line-tool to the select-tool...