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!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Bounding box

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 326 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.
    • honoluludesktopH Offline
      honoluludesktop
      last edited by

      When a component is selected, a blue box surrounds it's geometry, one corner of which is its axis. When I rotate the component, the blue box and axis rotates. The api makes reference to a BoundingBox (BB), but the documentation states that the BB is in reference to the world axis (as I have verified), not the component's blue box that rotates along with the component. Can anyone explain how I can access information regarding the axis of the blue box? Specifically, so that I can rotate the component on its axis origin along the z axis.

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        When you do:

        my_component.transformation.bounds

        you get the bounding box based on real world coordinates. So instead, use:

        my_component.definition.transformation.bounds

        and that will get the bounding box for the non-rotated component. Or if you have a group, which does not have a definition, you can use this method:

        my_group.local_bounds

        to get the local bounding box for the group.

        But your question is about the component axis, and you really don't need the bounding box for that. To get the component Instance bounding box, you can get it with:

        my_component.transformation.xaxis (or yaxis, zaxis).

        So if you want to rotate around the local z axis, use that method. Hope that helps,

        Chris

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

        1 Reply Last reply Reply Quote 0
        • honoluludesktopH Offline
          honoluludesktop
          last edited by

          Hi Chris, Thanks for pointing me in the right direction. This:

          
          if i.definition.name == e.definition.name						
             bondingbox = i.definition.bounds
             puts bondingbox.height #my code will go here
          end
          

          Did it for me:-) Even if this is not what I need to rotate the component, its good to learn anything.

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Moved the thread to the Developer's forum. We have reorganized so that the Plugin section is only a list of plugins you can download and use. πŸ€“

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            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