• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[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.
  • J Offline
    j_forrester
    last edited by 16 Mar 2010, 12:00

    Hi Guys,

    I searched the forum and cant seem to find what I'm after. Just wondered if anyone was aware of a Plugin that allowed you to select lines by angle or just vertical only in this case.
    I am want to extrude some lines but small left over vertical lines are stopping this happening, so have to manually delete hundreds.

    Picture 1.jpg

    The lines I'm extruding are not on the same z plane so it's not as easy as going into an elevation view and cross hair selecting an vertical lines.

    Many thanks...

    1 Reply Last reply Reply Quote 0
    • P Offline
      pilou
      last edited by 16 Mar 2010, 12:11

      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
      • T Offline
        TIG Moderator
        last edited by 16 Mar 2010, 12:18

        
        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
        • P Offline
          pilou
          last edited by 16 Mar 2010, 12:27

          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 16 Mar 2010, 12:51

            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
            • T Offline
              TIG Moderator
              last edited by 16 Mar 2010, 13:09

              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 16 Mar 2010, 13:12

                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
                • P Offline
                  pilou
                  last edited by 16 Mar 2010, 13:18

                  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
                  • T Offline
                    TIG Moderator
                    last edited by 16 Mar 2010, 13:19

                    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 17 Mar 2010, 11:41

                      it can't work in my sketch pro 7.0

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        TIG Moderator
                        last edited by 17 Mar 2010, 14:42

                        @hsjzyangbin said:

                        it can't work in my sketch pro 7.0

                        Why not ?

                        TIG

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

                        Advertisement