porting diagramdialog / choosevars, take 1