• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Ruby API and Ruby classes

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 623 Views 2 Watching
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
    MaryamR
    last edited by 20 Mar 2016, 14:30

    Hello everyone,

    i working on a sketchup plugin and i want to ask you, is it obligatory to have the entire program in one .rb file or is it possible to have a plugin with muliple classes ?

    For example class House, class Type ... and each class will contain methodes that will be used in one plugin.

    so is it possible to do so ? if yes how ?

    thnx in advance.

    1 Reply Last reply Reply Quote 0
    • S Offline
      slbaumgartner
      last edited by 20 Mar 2016, 16:40

      It is entirely permissible and pretty common to devote one file to each class. However, if you do so you will need to put your files into your own subfolder of Plugins, because otherwise SketchUp will try to load all of the individual .rb files as it starts up, which is not what you need. Instead, you should have a master file that loads/requires the others as and when needed. Also, you should look into the SketchUpExtension class, as it provides a natural way to manage your code in SketchUp. And, above all, you should wrap all of your code inside your own personal module to prevent it from clashing with other plugins and extensions.

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

      Advertisement