Find Paths With Odd Width
false
false
true
tools_menu.end
ruby
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# DESCRIPTION: Search paths with odd width in KLayout
#
# Run the script with
# klayout -rm search_odd_path_widths.lym ...
# or put the script as "search_odd_path_widths.lym" into the installation path (on Unix for version <=0.21:
# set $KLAYOUTPATH to the installation folder).
#
app = RBA::Application.instance
mw = app.main_window
lv = mw.current_view
if lv == nil
raise "No view selected"
end
cv = lv.active_cellview
if !cv.is_valid?
raise "No cell or no layout found"
end
cv.layout.each_cell do |cell|
(0..(cv.layout.layers-1)).each do |l|
if cv.layout.is_valid_layer?(l)
cell.shapes(l).each do |s|
if s.is_path? && (s.path_width % 2) == 1
if RBA::MessageBox::info("Path with odd width",
"Cell: #{cv.layout.cell_name(cell.cell_index)}\n" +
"Layer: #{cv.layout.get_info(l).to_s}\n" +
"Path: #{s.path.to_s}\n" +
"\n" +
"Press 'Ok' to continue, 'Cancel' to stop.",
RBA::MessageBox::b_ok + RBA::MessageBox::b_cancel) == RBA::MessageBox::b_cancel
raise "Operation aborted"
end
end
end
end
end
end