Automaticaly try to import files that aren't .sku

Re: Automaticaly try to import files that aren't .sku

Postby Dan Rathbun » Sat Feb 26, 2011 2:49 am

@Gruff: There's no reason why you can't use VBS for your IE side webdialog code. Using Javascript is NOT a requirement for Sketchup Ruby. It doesn't care what what scripting language is running in the browser.
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: Automaticaly try to import files that aren't .sku

    Postby Dan Rathbun » Sat Feb 26, 2011 2:58 am

    Gruff wrote:Can Ruby Scripts Accept a command line parameter on load?

    Nope

    Gruff wrote: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.
    0
      I'm not here much anymore. But a PM will fire email notifications.
      User avatar
      Dan Rathbun 
      PluginStore Author
      PluginStore Author
       

      Re: Automaticaly try to import files that aren't .sku

      Postby TIG » Sat Feb 26, 2011 2:55 pm

      Dan Rathbun wrote:
      Gruff wrote:Can Ruby Scripts Accept a command line parameter on load?

      Nope
      Gruff wrote: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...
      0
      TIG
      User avatar
      TIG 
      Global Moderator
       

      SketchUcation One-Liner Adverts

      by Ad Machine » 5 minutes ago



      Ad Machine 
      Robot
       

      Previous


       

      Return to Developers' Forum

      Who is online

      Users browsing this forum: liubo7911 and 5 guests

      Visit our sponsors: