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

A Ruby to display the name and creator of a ruby?

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 3.8k 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.
  • J Offline
    JClements
    last edited by 23 Nov 2007, 20:24

    Currently, when I install a ruby, I manually edit and add the .rb filename, creator, and sometimes revision level to the menu display. It works, but chews up space.

    Would it be possible to create a ruby which, when loaded when SU starts up, would automatically display the .rb filename of any script subsequently run in the task bar for example (or somewhere on the screen) and, if possible the creator's name and rev level? I assume there would have to be some type of global variable established for creator's name and rev level and values for those variables added to each .rb file.

    This info is helpful when trying to figure out if you have the most current rev loaded or if you have question about a script and want to address it to the creator here in this or another forum.

    John | Illustrator | Beaverton, Oregon

    1 Reply Last reply Reply Quote 0
    • A Offline
      azuby
      last edited by 23 Nov 2007, 20:25

      If the programmers would writing real extensions, you could see name etc. under Windows > Preferences.

      Would be possible to do this with variables, BUT: The programmers must write classes, not only simple methods including the following module in the way the class MyExtension does:

      module DescribedExtension
        @@author = ''
        @@version = ''
        # ...
      end
      
      class MyExtension > Sketchup;;Extension
        include DescribedExtension
        
        def initialize
          @@author = 'azuby' if @@author.empty?
          @@version = '1.0'  if @@version.empty?
        end
        
        # YOUR METHODS HERE
        
      end
      

      So you can ask the extension for info:

      if MyExtension.include? DescribedExtension
        puts MyExtension.author
        puts MyExtension.version
      end
      

      A much better way would be a kind of manger, which is could from extensions which include DescribedExtension. Than you only have to ask the manager for all described extensions.

      This is done in my approach to write an extension manager. But unfortunately the Sketchup Ruby API does not provide the required methods to finish my work. But you can go into the sources and look how it is done.

      azuby

      *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

      Bad English? PM me, correct me. :smile:**

      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