0

Does anyone know how to show quick select dialog by click on button on my new autocad form.

I use SendStringToExecute method, but it sends the command after closed the dialog

AcadApp.DocumentManager.MdiActiveDocument.SendStringToExecute("__QSELECT", true, true, false);

the above code dose not work, any one can help thanks to all

2 Answers2

1

I think this is not possible. You cannot run a command while a modal dialog box is displayed.

You can try to hide (Editor.StartUserInteraction) it and use a synchronous way to send a command to AutoCAD (like P/Invoke of acedCmd) but I've tried it and it crashes AutoCAD.

Typically, calling an AutoCAD command is a bad idea. .NET is not AutoLISP.

You can implement an interface similar to the QSELECT command and use it from your dialog box.

Maxence
  • 12,868
  • 5
  • 57
  • 69
  • Even if you found a way to do it I'd be surprised if it was robust. In my experience that sort of thing leads to all sorts of mysterious crashes and weird unexplained errors. – CAD bloke Oct 19 '15 at 08:26
0

Add a space after the _QSELECT. Something like:

Document autocadDocument = autocadDocumentManager.MdiActiveDocument;
autocadDocument.SendStringToExecute("_QSELECT ", false, false, true);

Or make your own QSELECT interface. That could be fun too.

BoredTweak
  • 28
  • 1
  • 6