• Login
sketchucation logo sketchucation
  • Login
Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

Component Ruby question

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 4 Posters 1.2k 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 19 Oct 2008, 22:45

    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
    • T Offline
      TIG Moderator
      last edited by 20 Oct 2008, 10:01

      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 20 Oct 2008, 12:22

        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
        • T Offline
          TIG Moderator
          last edited by 20 Oct 2008, 13:40

          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
          • S Offline
            scottlininger
            last edited by 21 Oct 2008, 22:45

            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 21 Oct 2008, 23:02

              Welcome to the forum Scott.

              Welcome to the forum Scott.

              🤣

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

              Advertisement