Community
I'm a bit late, but I add this for reference. The problem is that when you change the property Visible on the palette set (ps.Visible = true), AutoCAD execute the command associated to the palette set to show or hide it. The workaround is to stop the command and restart it when the palette is visible:
if (!ps.Visible) { ps.Visible = true; ed.EnteringQuiescentState += ed_EnteringQuiescentState; return; } [..] void ed_EnteringQuiescentState(object sender, EventArgs e) { var ed = (Editor) sender; try { ed.Document.SendStringToExecute(CMD + "\n", false, false, false); } finally { ed.EnteringQuiescentState -= ed_EnteringQuiescentState; } }