05/03/2022
This script will re-group all entities on the current LayOut Page by their class and style. It will be useful for fine adjusting your document or simply adjusting the imported objects from DWG.
Just copy the code below and paste it to your LayOut's RubyConsole. (Windows only)
#-----Copy from this row-------
doc = Layout.active_document
pages = doc.pages
entities = pages.initial.entities
entities.group_by{|c|
[
c.class,
c.layer_instance.definition.name,
c.style.solid_filled,
c.style.pattern_filled,
[
c.style.start_arrow_type,
c.style.end_arrow_type
],
c.is_a?(Layout::LinearDimension) || c.is_a?(Layout::Label) || c.is_a?(Layout::AngularDimension) ? [c.text.style.font_family, c.text.style.font_size] : [c.style.font_family, c.style.font_size],
]
}.values.each{|c|
Layout::Group.new(c)
}