Cell Bounding Box
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: Compute and output the bounding box of a cell (all layers)
#
# Run the script with
# klayout -rm cell_bbox.lym ...
# or put the script as "cell_bbox.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
view = mw.current_view
cv = view.cellview(view.active_cellview_index)
if !cv.is_valid?
return
end
cell = cv.cell
dbu = cv.layout.dbu
text = "Cell: #{cv.layout.cell_name(cv.cell_index)}\n\n"
text += "xmin: #{cell.bbox.left*dbu} micron\n"
text += "ymin: #{cell.bbox.bottom*dbu} micron\n"
text += "xmax: #{cell.bbox.right*dbu} micron\n"
text += "ymax: #{cell.bbox.top*dbu} micron\n\n"
text += "width: #{cell.bbox.width*dbu} micron\n"
text += "height: #{cell.bbox.height*dbu} micron"
RBA::MessageBox::info("Cell Information", text, RBA::MessageBox::b_ok)