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

    How to determine if selection is a surface

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 205 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.
    • Al HartA Offline
      Al Hart
      last edited by

      How can I determine it Sketchup.active_model.selection is a surface, and not just a bunch of faces?

      Al Hart

      http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
      IRender nXt from Render Plus

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

        Do yu mean surface as in lots of faces with soft/smooth edges in between?

        http://remusrendering.wordpress.com/

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

          I think you'd have to check if all the faces in the selection is connected with each other by Soft edges.

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

          1 Reply Last reply Reply Quote 0
          • Al HartA Offline
            Al Hart
            last edited by

            @remus said:

            Do yu mean surface as in lots of faces with soft/smooth edges in between?

            Yes - in particular I mean that thing, which if you right click on it in SketchUp and click "Entity Info" it reports it as a surface.

            If you created a cylinder and select just the curved face it is reported as a surface, but if you select the entire cylinder, it is reported as "NNN entities"

            Al Hart

            http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
            IRender nXt from Render Plus

            1 Reply Last reply Reply Quote 0
            • Al HartA Offline
              Al Hart
              last edited by

              @thomthom said:

              I think you'd have to check if all the faces in the selection is connected with each other by Soft edges.

              Aha - I searched the SketchUp API docs for surface and found this:

              @unknownuser said:

              Selection.is_surface?

              The is_surface? method is used to determine if the selection contains only all of the faces that are part of a single curved surface.
              
              Returns:
              
              status
                  true if the selection contains all faces that belong to a single curved surface. False if the selection does not contain all faces that belong to a single curved surface.
              
               selection.add entity
               status = selection.is_surface
              

              Al Hart

              http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
              IRender nXt from Render Plus

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

                Doh! I never noticed that method! 😳
                Nor is_curve? or single_object?.

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

                1 Reply Last reply Reply Quote 0
                • Al HartA Offline
                  Al Hart
                  last edited by

                  @thomthom said:

                  Doh! I never noticed that method! 😳
                  Nor is_curve? or single_object?.

                  I know. I searched the SCF first, but never thought to try to search the Ruby documentation.
                  (I kind of assume that if something is important we have discussed it here already.)

                  Actually their search works pretty well. (even better than that)

                  if you go to:

                  Error 404 (Not Found)!!1

                  favicon

                  (code.google.com)

                  And use their search box for something like "Curve" it displays text from and links to pages in the SketchUp documentation containing the word curve. (Just what you might expect it to - but I also suspected that it might search the whole universe for the word curve)

                  I need to use it more often.

                  Al Hart

                  http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                  IRender nXt from Render Plus

                  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