from axipy import Workspace, view_manager, CustomLabelProperties, Point


def getLayerByName(layers,name_layer):
    for i,layer in enumerate(layers):
        if layer.title==name_layer:
            return layer,i
    return None,None
path_wms=r"E:\Support\WorExample\s_ok\custom_label_1.mws"
layer_need_name='Licen_01_20'
Workspace().load_file(path_wms)
map_view=view_manager.views[0]
layers=map_view.map.layers
layer_need,id_layer=getLayerByName(layers,layer_need_name)
'''
axi_custom_label_1=CustomLabelProperties()
axi_custom_label_1.position=Point(7631306.9822909683,8926815.5960025955,map_view.coordsystem)
axi_custom_label_2=CustomLabelProperties()
axi_custom_label_2.position=Point(7619164.4748742199,8863227.5770377256,map_view.coordsystem)
#map_view.map.custom_labels.set(layer_need,1664,axi_custom_label_1)
map_view.map.custom_labels.set(map_view.map.layers[id_layer],1664,axi_custom_label_1)
map_view.map.custom_labels.set(map_view.map.layers[id_layer],1874,axi_custom_label_2)
'''
table=layer_need.data_object
for ft in table.items():
    id=ft.id
    name_value=ft['Название']

jkl=0