Numbering components

Hey oracles
So I often need to do large layouts with numbers for seats in my venue. Easy, and with the “Number Components” plugin from McGordon (which is a life saver!) it’s quick and really flexible. But now the challenge, how to number my components that are ARRAYED! Image for thoughts…

Maybe OpenCutList help if you send it to Layout or ( save your file before and )…

If you know hot to open Ruby console and you want something as the previous image, try to paste inside this:

module Rtches
module EtiquetasComponentes
  extend self
  model = Sketchup.active_model
  @entities = model.active_entities
  @instance = Sketchup.active_model.selection

  
  def comp_ctr(comp)
    Geom::Point3d::new(comp.bounds.corner(7))
  end
  
  def textinclude (insta)
    ar = insta.definition.name
    center = insta.bounds.center
    top = insta.bounds.max
    coordinates = [center[0],center[1],top[2]]
    text = @entities.add_text ar, coordinates
    type = text.arrow_type=0
    text.material = "blue"
    status = text.set_attribute "etiqueta", "tipo", "perso"
  end
  
  def putstext()
    model = Sketchup.active_model
    model.start_operation("Añade etiquetas", true)
    @instance.each { |i| textinclude(i) if i.is_a?(Sketchup::ComponentInstance)}
    model.commit_operation
  end

  def self.cleantexts()
    model = Sketchup.active_model
    model.start_operation("Borra etiquetas", true)
    @entities.each { |entity|
      value = entity.get_attribute("etiqueta", "tipo", "")
      entity.erase! if entity.is_a?(Sketchup::Text) && value =="perso"
    }
    model.commit_operation
  end
end
end

Then select your components and write this into the console:

Rtches::EtiquetasComponentes::putstext() to put texts
and
Rtches::EtiquetasComponentes::cleantexts() to remove them

1 Like

hey thanks for that. But I think the plugin Number Components does that great, when groups or components are in a straight line. But how to number them when the array is already in place. Or…I could number them in a straight line, but THEN need to array them, the group+the number?

You might try number rules and scales from sketchucation

1 Like

Try to select them by circle rows. Then prefix each row with r1_, r2_, etc. The result shoul be r1_1, r1_2, r1__3