It looks like you're new here. If you want to get involved, click one of these buttons!
I'd like assign a layer name for a layer that I created in my python script. This layer name I want create in such a way that it is stored in the oasis file.
When you create a layer in a Layout object with Layout#insert_layer you can pass a LayoutInfo object with up to three properties:
Layout#insert_layer
LayoutInfo
like this:
ly = pya.Layout() # creates a layer with layer/datatype 1/0 and name "layer1" l1 = ly.insert_layer(pya.LayerInfo(1, 0, "layer1"))
Matthias
Yes that did the trick. How do I modify the layer name of an already existing layer?
You use "Layout#set_info" (https://www.klayout.de/doc-qt5/code/class_Layout.html#k_143) with the layer index and the new LayerInfo object.
LayerInfo
To change just the name, use
index = ... the index of the layer to change info = layout.get_info(index) info.name = "NEW_NAME" layout.set_info(index, info)
Comments
When you create a layer in a Layout object with
Layout#insert_layer
you can pass aLayoutInfo
object with up to three properties:like this:
Matthias
Yes that did the trick. How do I modify the layer name of an already existing layer?
You use "Layout#set_info" (https://www.klayout.de/doc-qt5/code/class_Layout.html#k_143) with the layer index and the new
LayerInfo
object.To change just the name, use
Matthias