sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    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

      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

        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
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement