string $activePanel = `getPanel -wf`;
if (`modelEditor -q -nurbsCurves $activePanel` == 1) {
modelEditor -e -nurbsCurves 0 $activePanel;
} else {
modelEditor -e -nurbsCurves 1 $activePanel;
}
https://drive.google.com/file/d/1BYt9zSloj_DWi6EvSw-cEzbnbSP5gjHD/view?usp=sharing