Can I hide all edges within a multi-level component?

Hi folks.

I’m dealing with components of houses imported from Archicad.
When they come through as SKP files they are in hundreds of components (each piece of timber, each window pane). I don’t particularly want to explode and reorganise them.

I’m looking for a quick way to make all their edges hidden, without having to go into each component and manually select and hide the edges.

Is there a quick way of doing this? maybe a ruby script?

Thanks!

Why don’t you change the style? You can hide edges.

If you want to hide all the edges in the model, you can do the setting in Style, and if you want to hide the edges only from certain groups/components (even nested ones) without opening them for editing, you can use the Curic Deep Select extension.

2 Likes

A quick one:
Copy-paste this code below to Ruby console and hit Enter.
You will get a menu in “Extensions”> “Hide edges” and “Unhide edges”.
Select the entities which you want to make all their edges hidden (or visible). Choose the corresponding menu above. All edges will be processed, recursively inside nested components/groups too.
The amount of processed edges will be printed to console.
You can undo it.
As usual: No warranties, Use your own risk.

module Dezmo::Hide_Edges
  extend self
  
  def edges_visible( state, ents )
    ents.each { |e|
      if e.is_a?( Sketchup::Edge )
        e.visible = state
        @count += 1
      elsif e.is_a?( Sketchup::ComponentInstance ) || e.is_a?( Sketchup::Group )
        edges_visible(state, e.definition.entities )
      end
    }
  end

  def run( state = true )
    model = Sketchup.active_model
    sel = model.selection
    return UI.messagebox "Please select entities!" if sel.empty?
    @count = 0
    op_name = state ? "Edges unhide" : "Edges hide"
    model.start_operation(op_name,true)
      edges_visible( state, sel.to_a )
    model.commit_operation
    puts "#{op_name} #{@count}"
  end
  
  unless defined?(@ui_loaded)
    UI.menu("Plugins").add_item("Hide edges") { run false }
    UI.menu("Plugins").add_item("Unhide edges") { run }
    @ui_loaded = true
  end
end
1 Like

Amazing, thank you!

This will be such a time saver for me.

Hiding edges has a very significant benefit to graphics performance for larger/complex models.

1 Like

I know there are occasions where SketchUp’s renderer is to blame for poor performance - having too many edges visible slows things to a crawl, but you need the edges if you are to carry on working on the model.
Tags and hiding things is one way to deal with it, but sometimes you simply just don’t need the edges to exist on the model.

You may try this:

1 - With all edges visible, create a scene and call it as you want, for example, Edges On. Uncheck the box labeled Camera position to avoid loosing a carefully composed view.

2 - Open the Styles Window or Style Tray and create a new style.

3 - Hide the edges and profiles.

4 - Update that new style.

5 - Create a new scenes and call it as you want, for example, Edges Off.

That’s it. From now on, you can just click on the appropriate scene tab to hide or show the edges.

I know in many cases you might have some ridiculous plant model or high poly chair which drags everything down and you basically never ever need the edges to exist for that object in SketchUp - perhaps your end goal is to take it into a renderer.
The simple answer would be “don’t use them” however in reality this isn’t always possible.

I know that’s why I will physically hide the edges in a component - using scenes or tags in itself causes other judders , pauses or feeling of instability or issues in the model as you switch.

Some of these issues will be significantly reduced in SU 2024, but also using edges as a visual representation of an angle, edge or boundary will also not be the only way, so per object control may be more useful than ever…

Hi Dezmo, I’m wondering if there’s a way to run this operation but for unchecking smooth/soften on all linework. I’m using Speckle to import Rhino models into Sketchup and it works great but for one reason or another it smooths all edges for each individual object imported, making for a tedious process to undo.

This is what I do. I mean, you only need one or two edges to assist with placing a componetn, scaling or dimensioning in layout… 90% of components simply don’t need to use edges at all.

These components are typically placed on a tag (encompassing details like trees, people, vehicles, interior furniture, guttering, hot air balloons in the background), This means they can be turned off when using SketchUp, but it opens some valuable possibilities in LayOut, too, which is where performance suffers the most in edge-heavy scenes.

It would be very helpful if LayOut could include a setting for Tags to turn edges completely off (ignoring them completely). Right now we can turn them down to thickness 0.1pt or make them transparent in color… But I wonder if ignoring them would be even faster and easier.

Going one small step further, what if we could select which tags to render in Raster mode? That would be really cool (then edges and even face geometry (hidden edges) could in theory be ignored by layout for that Tag… A tag rendered in Raster mode becomes a bitmap only , for visual reference). That would massively reduce the amount of geometry needing to be processed by LayOut (for snapping, and all sorts).
@adam - it’s be good to get your thoughts on this!

No. This snippet is for hide/unhide. For smooth/soften edges you need an other one.

E.g. :

https://sketchucation.com/pluginstore?listtype=1&author=0&category=0&search=soften&submit=%3F

Curic Deep Select has its quirks but it lets you select edges in nested objects.