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

    Component Ruby question

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 1.1k Views 4 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.
    • R Offline
      rhinocat
      last edited by

      Sorry if this has been asked before, but I have done a prety good search on the forum and internet.

      How do you make a component like you would use the group = entities.add_group. Is there a way to make a component instead of a group and asign it a name in a ruby script?

      Thanks

      Matt

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        http://download.sketchup.com/OnlineDoc/gsu6_ruby/Docs/ruby-definitionlist.html#add - adds a Definition to the Model then...
        http://code.google.com/apis/sketchup/docs/developers_guide/index.html - lets you manipulate the definition's entities...
        Then you have to add instances etc...

        Alternatively I'd make the Group, do the entities etc and then use...

        group.to_component

        to get the component definition and instance.

        TIG

        1 Reply Last reply Reply Quote 0
        • R Offline
          rhinocat
          last edited by

          TIG,

          Thanks so much, I don't know why I could not find this, but I am new to Ruby. It seams very easey, can I ask what is the editor of choice when scripting in Ruby for Sketchup?

          Thanks,

          Matt

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            I use "Notepad++.exe" with appropriate ruby settings for .rb files - BUT there are many other apps...

            TIG

            1 Reply Last reply Reply Quote 0
            • scottliningerS Offline
              scottlininger
              last edited by

              On PC, I prefer EditPlus. You can get a ruby syntax highlighter from their website, too.

              -Scott Lininger
              Google SketchUp Engineer

              • Scott Lininger
                SketchUp Software Engineer
                Have you visited the Ruby API Docs?
              1 Reply Last reply Reply Quote 0
              • T Offline
                todd burch
                last edited by

                Welcome to the forum Scott.

                Welcome to the forum Scott.

                🤣

                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