import pymel.core as pm import maya.mel as mel def create_win(title): win_id = 'MyWin' def close(*pArgs): if pm.window(win_id, ex=1): pm.deleteUI(win_id) if pm.window(win_id, ex=1): pm.deleteUI(win_id) def apply(*pArgs): n = pm.intSliderGrp(n_slider, q=1, v=1) mel.eval('polySelectEdgesEveryN("edgeRing", {})'.format(n)) pm.window(win_id, t=title, sizeable=0, resizeToFitChildren=1) pm.rowColumnLayout(p=win_id, nc=1, cw=[(10, 150)], co=[(1, 'left', 5)]) n_slider = pm.intSliderGrp(min=1, max=100, v=1, field=1) pm.button(l='Apply', c=apply) pm.button(l='Close', c=close) pm.showWindow() create_win('SelectLoopNum')