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

    Visibility in Group/Component editing

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 427 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.
    • T Offline
      tomasz
      last edited by

      I have two tools that are using model.raytest(ray) and have bumped into a problem with DrawingElement visibility in Group/Component editing mode.

      All DrawingElement methods dealing with visibility - visible? and hidden? they refer to a state of the element in a model, but are completely unaware of a visibility of the element on a screen (OpenGL 3D space to be "precise").

      Group/Component editing options allow to Hide elements from a view, but how can we check it from Ruby?! Is there a way to figure out whether such an entity is really "visible on a screen".

      Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

      1 Reply Last reply Reply Quote 0
      • T Offline
        tomasz
        last edited by

        I have found Model.active_path from SU 7.0+. It looks I will have to compare an oldest entity in a family I get from the raytest with oldest entity from the active_path...

        Are there users still using SU6? πŸ˜„

        Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

        1 Reply Last reply Reply Quote 0
        • jolranJ Offline
          jolran
          last edited by

          The only one I could think of is Pilou πŸ˜‰

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

            @tomasz said:

            I have two tools that are using model.raytest(ray) and have bumped into a problem with DrawingElement visibility in Group/Component editing mode.

            All DrawingElement methods dealing with visibility - visible? and hidden? they refer to a state of the element in a model, but are completely unaware of a visibility of the element on a screen (OpenGL 3D space to be "precise").

            Group/Component editing options allow to Hide elements from a view, but how can we check it from Ruby?! Is there a way to figure out whether such an entity is really "visible on a screen".

            Use the second item in the returned array, with is the instance path array. Traverse through this and check if any of these entities are hidden on on a hidden layer. Works in all versions of SU.

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

            1 Reply Last reply Reply Quote 0
            • T Offline
              tomasz
              last edited by

              @thomthom said:

              Use the second item in the returned array, with is the instance path array. Traverse through this and check if any of these entities are hidden on on a hidden layer. Works in all versions of SU.

              Thomas, it is not what I have been looking for. I know that this works, but I doesn't give you an info on whether an object is hidden by 'Group/Component editing' option from the 'Window/Model Info/Components'.

              The Model.active_path solution works very well. I have to obviously traverse whole active_path and compare each element with the second element of rayrest return.

              Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

              1 Reply Last reply Reply Quote 0
              • T Offline
                tomasz
                last edited by

                @jolran said:

                The only one I could think of is Pilou πŸ˜‰

                πŸ˜„

                Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

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

                  Ah, ok now I understand. Yes, then Model.active_path is what you need. And checking if Hide Rest of Model or Hide Similar Components is enabled.

                  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