from axipy import menubar, ObserverManager, data_manager, Position

from ru_rubtsov_axioma_topo_tools.Test.TestGuiSnap.snapPoints import SnapPoints
from ru_rubtsov_axioma_topo_tools.ui.DlgFormTopoCorrect import getTolleranceTable


def runSnap():
    name_tab = 'test_topo_3857_1_Z'
    tab_source = data_manager.find(name_tab)
    tollerance_tab = getTolleranceTable(name_tab)
    cls_snap = SnapPoints(name_tab, tollerance_tab)
    cls_snap.run()
    print("End Snap")

button = menubar.ActionButton(
    'TestSnapNodes',
    on_click=runSnap,

    enable_on=ObserverManager.HasTables
)
position = Position("Основные", "Команды")
position.add(button)
jkl=0