[Request] Select vertical lines only
-
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.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...
-
you have a plug from Chris Fullmer that select lines by length
Seeing your image maybe this can help you -
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 typeselectverticallinesonly
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?}
-
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?}
-
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
-
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... -
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..
-
Seems you have not taken the good format of file for save it
here the mine
-
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 filexxx.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 aload "xxx.txt"
Where
xxx.txt
is the name of atxt
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...
-
it can't work in my sketch pro 7.0
-
Advertisement