How can I select

Oh, have a nice holiday, I hope you’ll be back soon to assist me with this.

Thanks. Enjoy the beer.

1 Like

I don’t know about the selection question, but @thomthom may have ideas.

It looks like you have had problems setting up your Trimble ID. I resent the confirmation email.

You may need to do the Forgot Password step too.

1 Like

Does anyone know “Rube console”? I think the above problem is not too difficult for those who know about programming. I waited 2 weeks and no one helped

It looks that you’re not right with this statement. If it is really easy, then someone should give the solution already.

I’m terribly sorry I’m on vacation and can’t satisfy your desire. If I come back and find a solution I will let you know.

1 Like

thank you. Wish you health. It will be great when thousands come back

That’s the best I can come up with… currently :blush::
(It means there is no “simple” solution :frowning: )

def keep_interior_faces_selected_2
  sel = Sketchup.active_model.selection
  faces = sel.grep(Sketchup::Face)
  b_faces = []
  faces.each{|f|
    f.edges.each{|e|
      if e.faces.size == 1 && f.outer_loop.edges.include?(e)
        b_faces.push(f) 
      end
    }
  }
  b_faces.uniq!
  sel.remove(b_faces, sel.grep(Sketchup::Edge))
  return "Number of faces remain selected: #{sel.size}"
end
keep_interior_faces_selected_2

sel2

1 Like

@dezmo

Thank you for coming back.

It’s really perfect for flat surfaces

With extruded surfaces it doesn’t work

Do you have any way to fix it?

Not really. I spent couple of hours, but find this “limited to flat surfaces” only… :frowning:

1 Like

def keep_interior_faces_selected
sel = Sketchup.active_model.selection
faces =sel.grep(Sketchup::Face)
bad_faces = faces.find_all{|f| f.loops.find{|l| !l.outer?} }
sel.remove(bad_faces, sel.grep(Sketchup::Edge))
sel.size
end
keep_interior_faces_selected

@dezmo
This code of yours works with extruded objects

But it doesn’t work with inner hollow surface objects and it doesn’t ignore

I know.
The Ruby is not a “Magic wand”. There is a limitation in it.
Moreover, I have my own limitation too… I have no more Idea currently. Sorry. You will be the first person informed, if something may come to my mind later.

2 Likes

@dezmo
hi. thank you very much.
Enjoy a beer. I hope it helps you relax and refresh.

1 Like

Let’s try the code below:

selection = Sketchup.active_model.selection
interior_faces = selection.grep(Sketchup::Face).find_all do |face| 
  face.outer_loop.edges.all? do |edge| 
    edge.faces.length == 2 && 
      edge.faces.first.normal.parallel?(edge.faces.last.normal)
  end
end
selection.remove(selection.to_a - interior_faces)

puts "interior_faces: #{interior_faces.length}"
1 Like

Thanks @voquochai . I’ll check

@voquochai

Hello.
Your code is working like example “A”

I want it to work like example “B”

I see, all of my objects have a common feature, that is, only the 2nd side is taken from the outside, the

This seems to take a few steps to process:
You can follow the quick idea in my head right now:

  • Find and group all faces that are coplanar and share common edges
  • Sorting by parity based on the outermost face
  • The outermost face is the face with the outer loop whose edge does not share the same face with the rest of the faces in the divided group.

@voquochai

Thank you for sharing.
I’m not a programmer, this would be more difficult for me.
Hope someone will help me.

It’s starting to look like you may want to head over to the Commercial and Collaborative Work section of the forum and work directly with someone to create a custom extension for you.

1 Like

Thank you for comment.

Just a little more and it’s done. I hope to be of help.

Que extensão é essa???