It looks like you're new here. If you want to get involved, click one of these buttons!
Hello. Klayout newbie here. I have a silly question.
So I tried to create a shape in my existing layout. Below is the script.
include RBA
app = RBA::Application.instance
mw = app.main_window
lv = mw.current_view
cv = lv.active_cellview
# define points in the shape here
circle = Polygon.new(pts)
cv.shapes(circle_layer).insert(circle)_
Then there is an error saying shapes is not a method for cellview. I guess defining cv as lv.active_view doesn't make cv a cell object. How can I point to the current cell and create a shape then?
I browsed many examples. Most of them start by creating a cell, which doesn't apply here.
Thanks!
Comments
Hello kikixu90,
devired from another contribution in this forum, here is an example. The code is not functional, but I think it solves your problem.
Best Leo
Yes, the solution basically is to use "cv.cell" rather than "cv" itself.
"CellView" is identifying a particular layout shown in a "LayoutView" in terms of layout, cell shown etc. Use the "cell" property to access the cell which is currently shown. With this cell object you can use "shapes" to access the shapes container for a single layer.
Matthias