• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Reporting component geometry data into Ruby Console

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 3 Posters 274 Views 3 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
    robintb
    last edited by 5 Mar 2009, 10:38

    A basic question I'ms sure this is but I can't figure out how to do it:

    I have a component I have created (its a basic shape) that I wish to use in several sketchup models. I want to report the geometric data into the ruby console e.g. its centre point (in terms of x,y,z) once I have placed it into the model. How can I do this, given that the component has a specific name e.g. R1?

    Many thanks for your help. Much appreciated

    Robin

    1 Reply Last reply Reply Quote 0
    • C Offline
      Chris Fullmer
      last edited by 5 Mar 2009, 16:21

      Hi Robin, I started working on a script that shows model info right on the screen and down in the bottom left corner. Here is a link

      301 Moved Permanently

      favicon

      (www.sketchucation.com)

      It could be adapted to also display the center of the a component if that is what you'd like. Check it out and see if that would be helpful.

      Also, this script it just a minor variation of the "Query" tool that comes with SketchUp.

      Chris

      Lately you've been tan, suspicious for the winter.
      All my Plugins I've written

      1 Reply Last reply Reply Quote 0
      • R Offline
        robintb
        last edited by 12 Mar 2009, 15:55

        thanks for your help Chris, meant to reply sooner

        but I want to see a list of components in ruby, ultimately so I can calculate the distance between two defined objects. I want to do this using code rather than measuring the distance as I ultimately want to apply a separate calculation based on the distance.

        I was hoping it would take the form of:

        List the components in ruby, say component_1 and component_2, listed as

        component_1 [5,1,2]
        component_2 [10,12,3]
        etc

        then I can use these points in space to do a variety of mathematical calculations

        Thanks

        Robin

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 12 Mar 2009, 17:23

          Try component_instance.transformation.to_a - it returns a 16 item array that has all of the stuff you need like scaling rotation and location. You really need to use all of these to compare distances between components etc as they might be rotated, scaled etc as well as moved in XYZ...

          The 16 item array has items 12,13,14 == x,y,z

          .

          TIG

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

          Advertisement