I'm not able to get the layer and datatype correct out of my layout.
The values do not match the current situation, some are correct other wrong.
from pya import *
lv = pya.Application.instance().main_window().current_view()
layout = lv.active_cellview().layout()
sel_layers=[]
sel_layers = lv.selected_layers()
if len(sel_layers) == 0:
print("No Layer selected")
for l in sel_layers:
a = l.current()
li = a.layer_index()
myLayer = layout.layer(li,0)
info = layout.get_info(myLayer)
print(info.name, info.layer, info.datatype)
BR,
Andy
Comments
Hi Andy,
This should be sufficient:
BTW: This Forum supports Markdown. So you can format source code using four spaces as indent. For Python this is mandatory - otherwise I can only guess the code structure.
Matthias