It looks like you're new here. If you want to get involved, click one of these buttons!
I have a design and I would need to map the layers such as:
I could not find a way to do this without using multiple intermediate designs.
I block mainly when I try to map one layer to several layers.
here is a starting code but not working:
lo = pya.LoadLayoutOptions()
lm = pya.LayerMap()
lm.map(pya.LayerInfo(9, 70), 0, pya.LayerInfo(1000, 0, "lay1"))
lm.map(pya.LayerInfo(9, 70), 1, pya.LayerInfo(1001, 0, "lay2"))
lm.map(pya.LayerInfo(160, 0), 2, pya.LayerInfo(1000, 0, "lay1"))
lo.read_all_other_layers = False
lo.layer_map = lm
the issue in this code are:
Thanks in advance for any help
Comments
Have you already read the
LayerMap
docstring? From that I understand that multiple physical layers can be mapped to a single logical on but the reverse does not makes sense. If you just want to "see" the stuff in the GUI on the same "layer view" you can do so by selecting corresponding source. See about layer sources and LayerProperties. If you actually need the two layers in the database with the same geometry, you should copy the database layer I guess. Perhaps it helps if you would describe more what you actually need to do.Thanks for the link and the reply
unfortunately the reverse does make sense to me, maybe the example above is not complete enough we could add a layer to map 1.0 -> 1001.0
because of such map the copy would force me to create an intermediate layer then copy it to two layers, then delete it. I would rather avoid intermediate layers, therefore my question if there is a way to map directly.
I also don't plan to "see" anything, it is solely about having one design input and remapping the layers to other layers.
My question may not be so clear so we could also put it like this:
I have a design1, I need to convert the layers to design2 with a mapping:
what do you think it is the best path to go? Just an advice would be enough.
@jonathan I'm sorry, but real n:m mapping isn't supported currently. You can't map a single source layout to multiple destination layers. I know this may be desired, but the reader's code simply doesn't support this application currently.
You can duplicate or merge the layer in a later step however using
Layout#copy_layer
.Matthias
Thank you for the reply,
I then ended up with then creating intermediate layers and copy these layers to the correct one, here is a sample code: