I create with the following script a circle in my layout, in the hiearchy and visible as a small point in my layout.
When I select it and without any changes click ok the pcell becomes visible as expected.
I assume I miss soemthing in my script to "activate" the pcell.
The radius is always 0.1 um independent which value I provide.
Any feedback is highly appriciated.
Thanks,
Andy
include RBA
layout_view = Application.instance.main_window.current_view
layout = layout_view.active_cellview.layout
top = layout_view.active_cellview.cell
$myLayerCircle = layout.layer(2, 0)
$radius = 100
# to get um
dbu=layout.dbu
pcell = layout.create_cell("CIRCLE", "Basic", {"layer" => $myLayerCircle, "actual_radius" => $radius, "npoints" => 64 } )
layout_view.add_missing_layers
trans = Trans.new(Trans::R0, 0, 0)
top.insert(CellInstArray.new(pcell.cell_index(), trans))
# write to gds
layout.write("circle.gds")
Comments
Hi Andy,
I don't know what's going on precisely, but this is working code:
In general, I discourage from using the Basic PCell's in code. They were provided with editing in mind.
A circle can be created much easier as a polygon this way:
Kind regards,
Matthias
The layer generation made the difference.
Idea and long term project behind is on how parametrized shapes could be used e.g. for a basic transistor layout.
The pcell intend to be placed in concunction with donut to layout them in a larger array with slightly changing the radius for the donut and circle.
Cheers,
Andy