[REQ] Tool to delete faces without thickness.
-
It would be possible to create a tool to delete the edges that form a face that does not form a solid?
In the sample image, I wish erase the blue faces.
-
Select the faces in question then try this on-liner type/copy+paste it into the Ruby Console + <enter>
Sketchup.active_model.selection.to_a.each{|f|next if not f.valid? or not f.class==Sketchup;;Face; f.edges.each{|e|e.erase! if e.valid? and not e.faces[1]}}
it does what you ask...
-
Yes!!! How can I make a menu for set keyboard Shortcut?
-
@bagatelo said:
Yes!!! How can I make a menu for set keyboard Shortcut?
Copy+paste this code into a new file calledDeleteSelectedNonSolidFaces.rb
and on a restart you will get a Plugins menu item of that name - shortcut-key to that as desired...<span class="syntaxdefault"></span><span class="syntaxkeyword">class </span><span class="syntaxdefault">DeleteSelectedNonSolidFaces<br /> def initialize<br /> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">selection</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">to_a</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each</span><span class="syntaxkeyword">{|</span><span class="syntaxdefault">f</span><span class="syntaxkeyword">|</span><span class="syntaxdefault">next </span><span class="syntaxkeyword">if </span><span class="syntaxdefault">not f</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">valid</span><span class="syntaxkeyword">? or </span><span class="syntaxdefault">not f</span><span class="syntaxkeyword">.class==</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Face</span><span class="syntaxkeyword">; </span><span class="syntaxdefault">f</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">edges</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each</span><span class="syntaxkeyword">{|</span><span class="syntaxdefault">e</span><span class="syntaxkeyword">|</span><span class="syntaxdefault">e</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">erase</span><span class="syntaxkeyword">! if </span><span class="syntaxdefault">e</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">valid</span><span class="syntaxkeyword">? and </span><span class="syntaxdefault">not e</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">faces</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">]}}<br /> </span><span class="syntaxdefault">end<br />end<br /></span><span class="syntaxkeyword">if </span><span class="syntaxdefault">not file_loaded</span><span class="syntaxkeyword">?(</span><span class="syntaxdefault">File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">basename</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__FILE__</span><span class="syntaxkeyword">))<br /> </span><span class="syntaxdefault">UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">menu</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Plugins"</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"DeleteSelectedNonSolidFaces"</span><span class="syntaxkeyword">){</span><span class="syntaxdefault">DeleteSelectedNonSolidFaces</span><span class="syntaxkeyword">.new()}<br /></span><span class="syntaxdefault">end</span><span class="syntaxcomment">#if<br /></span><span class="syntaxdefault">file_loaded</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">basename</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__FILE__</span><span class="syntaxkeyword">))<br /> </span><span class="syntaxdefault"></span>
-
UNBELIEVABLY. Great. Thank you.
-
Call me little 'youngling'. I have done some modification in cleanup plugin.
http://forums.sketchucation.com/viewtopic.php?f=323&t=22920&p=310264#p310264
Advertisement