To use Cell#copy_tree, you'll need to create two layouts, load the two files into these two layouts and then copy over the source cell into the target cell using Cell#copy_tree.
The safer (but slower) way is to read each layout into a separate pya.Layout object and copy the content over from this local layout to the target one using Cell#copy_tree. This will assign unique cel
But what's definitely missing is an easy way to enforce coerce_parameters. How about something like "Cell#coerce_pcell_parameters" or "Instance#coerce_pcell_parameters&q
But what if "#CODE GOES HERE" is very long code, and you have many buttons, so it is unweildy (and bad organization) to paste all these on_triggered actions in one macro. Well, if it
OK, I did some more reading and I see that the code wrapper I was using was from old scripts before macros. (From http://klayout.de/forum/comments.php?DiscussionID=310&Focus=1425#Comment_1425)
* copy over the shapes and cell tree from that new layout into the master layout using Cell#copy_tree: "target.copy_tree(newLayout.top_cell)"
since 0.23.x there is a method Layout#convert_cell_to_static which converts a PCell to a static cell. It takes the cell index of the proxy cell (that is a representative of the PCell in the layout) an
If the "read again" approach is too simplistic, I can offer Cell#copy_tree_shapes. There is a version of that method which takes a CellMapping object which allows to be very specific
Since version 0.23.x there is better support for copying shapes, instances and even cell trees across layouts. Have a look at the Cell#copy... method family. There are even hierarchical copy functions
make this work #libs = [] #pcells = [] #counter = 0; #RBA::Library.library_names.each_with_index { |l,i| # libs.push(l) # pcell_list = #Get a list of the pcells in library l #lib
Regarding 1.), I just answered a similar request here: http://klayout.de/forum/comments.php?DiscussionID=439&page=1#Comment_1873. In your case, since you have a STROKED_POLYGON PCell, the para