sketchucation logo sketchucation
    • Login
    ⚠️ Attention | Having issues with Sketchucation Tools 5? Report Here

    [Request] Select vertical lines only

    Scheduled Pinned Locked Moved Plugins
    11 Posts 4 Posters 1.5k 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.
    • pilouP Offline
      pilou
      last edited by

      you have a plug from Chris Fullmer that select lines by length
      Seeing your image maybe this can help you

      Frenchy Pilou
      Is beautiful that please without concept!
      My Little site :)

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        
        def selectverticallinesonly()
          model=Sketchup.active_model
          ss=model.selection
          ssa=ss.to_a
          ss.clear
          es=[]
          ssa.each{|e|
            if e.class==Sketchup;;Edge and e.line[1].z.abs==1
              ss.add(e)
              es << e
            end#if
          }
          return es
        end#def
        
        

        Copy/paste all of this code into a file called selectverticallinesonly.rb in the Plugins folder.
        To use it you simply make a selection that includes the vertical lines you want separating out, then in the Ruby Console type selectverticallinesonly and only vertical lines should remain highlighted...
        It returns an array of these vertical lines, so to delete them automatically use something like
        selectverticallinesonly.each{|e|e.erase! if e.valid?}
        πŸ€“

        TIG

        1 Reply Last reply Reply Quote 0
        • pilouP Offline
          pilou
          last edited by

          Press the "Select all" code button else you will miss 2 lines of the code πŸ˜‰

          for kill the verticals you must close the Ruby console after run it if you dont want use the line selectverticallinesonly.each{|e|e.erase! if e.valid?} πŸ˜‰

          Frenchy Pilou
          Is beautiful that please without concept!
          My Little site :)

          1 Reply Last reply Reply Quote 0
          • J Offline
            j_forrester
            last edited by

            Thanks for the help guys. I've saved the code out as a .rb file but get the error message below. Running Mac OS 10.5.8. Sketchup 6 Pro

            [attachment=1:2g4do1ag]<!-- ia1 -->Also file i created Picture 2.png<!-- ia1 -->[/attachment:2g4do1ag]

            Also .rb file I created if correct


            Picture 2.png


            selectverticallinesonly.rb

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              Thanks Pilou... πŸ˜„

              j_forrester:
              You have used a word-processor to make the '.rb' file!
              It must be a plain text-file format - so you need to use something like Notepad.exe on PC, or a Mac equivalent [Bbedit?]... Any 'formatting' kills the SUp Ruby interpretor... πŸ˜•

              TIG

              1 Reply Last reply Reply Quote 0
              • J Offline
                j_forrester
                last edited by

                Thank you Pilou for sorting that out. I must be saving them out in an incorrect way. Sorry but by what means do you save yours, hopefully if I get it right I wont have to ask for help so often. Also thanks a lot to TIG for the code, another great job thanks a lot, works perfectly!

                Edit: just read TIG comment about plain text format, i'll look into that. Thanks again..

                1 Reply Last reply Reply Quote 0
                • pilouP Offline
                  pilou
                  last edited by

                  Seems you have not taken the good format of file for save it πŸ˜‰

                  here the mine πŸ˜‰


                  selectverticallinesonly.rb

                  Frenchy Pilou
                  Is beautiful that please without concept!
                  My Little site :)

                  1 Reply Last reply Reply Quote 0
                  • TIGT Offline
                    TIG Moderator
                    last edited by

                    Open a new empty plain-text file [using say BBedit] and save it as xxx.txt and type or copy/paste the code in and save/close. After saving rename that file xxx.rb - you now have a Ruby script that will auto-load when SUp starts.

                    You can load a script that is a plain txt file - by typing code into the Ruby Console as you need it... like a

                    load "xxx.txt"

                    Where xxx.txt is the name of a txt file in the Plugins folder.

                    As long as the text in the file is a valid script it will load and return [print] 'true' and the 'tool' will hen be available to you to use, just in that session, of that model...
                    πŸ’­

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      hsjzyangbin
                      last edited by

                      it can't work in my sketch pro 7.0

                      1 Reply Last reply Reply Quote 0
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        @hsjzyangbin said:

                        it can't work in my sketch pro 7.0

                        Why not ?

                        TIG

                        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