It looks like you're new here. If you want to get involved, click one of these buttons!
I am trying to use Python scripting to create some cells that will themselves be nested within other cells.
So far I can only find commands to create a new cell as a top-level cell, not a nested one. e.g.
layout.create_cell("NewCell")
will create a new, top-level cell named "NewCell"
Now let's say I've created another cell:
layout.create_cell("OtherCell")
How would I get OtherCell to be nested under NewCell in the cell hierarchy?
Comments
I imagine you'd open NewCell as top, then place an instance
of OtherCell (specify coords) in the layout.
How that looks in Python, no idea.
Maybe can do this play
https://www.klayout.de/forum/discussion/comment/9004#Comment_9004
Here is a simple example using the IDE.

I hope the code is self-explanatory and helps you.
You can find a more complex example here
Thanks Vincent Lin. This worked.
Attached is a simplified version of the above example for self-reference.