Author Topic: eDocumentSwitchDisabled  (Read 2649 times)

0 Members and 1 Guest are viewing this topic.

GUIDO ROOMS

  • Guest
eDocumentSwitchDisabled
« on: August 13, 2012, 07:21:07 AM »
Just found out that if I try to switch the active document from a modal dialog I get this error.
CommandFlags.Session is no help.
Locking documents is no help.
The dialog has to be modeless, in this case everything works.
Well, let's hope I'm right.

Loving Autodesk more and more each day.
To the blockheads who've written those docs: things like that should be *prominent* in the documentation
and should not be left to be inferred by trial and error.

Alexander Rivilis

  • Bull Frog
  • Posts: 214
  • Programmer from Kyiv (Ukraine)
Re: eDocumentSwitchDisabled
« Reply #1 on: August 13, 2012, 07:40:55 AM »
Maybe this code help you:
Code: [Select]
Application.DocumentManager.DocumentActivationEnabled = true;

GUIDO ROOMS

  • Guest
Re: eDocumentSwitchDisabled
« Reply #2 on: August 13, 2012, 08:32:33 AM »
Thanks a lot Alexander.
This works.
Saves my day.

GUIDO ROOMS

  • Guest
Re: eDocumentSwitchDisabled
« Reply #3 on: August 13, 2012, 11:29:56 AM »
Maybe an interesting remark:
Since in the dll I'm currently writing, all dialogs will be executed modally,
I tried to be clever and put the  line  Application.DocumentManager.DocumentActivationEnabled = true;
in Initialize(), but that doesn't work.

Thanks again for your reply.

Alexander Rivilis

  • Bull Frog
  • Posts: 214
  • Programmer from Kyiv (Ukraine)
Re: eDocumentSwitchDisabled
« Reply #4 on: August 13, 2012, 04:44:28 PM »
Maybe an interesting remark:
Since in the dll I'm currently writing, all dialogs will be executed modally,
I tried to be clever and put the  line  Application.DocumentManager.DocumentActivationEnabled = true;
in Initialize(), but that doesn't work.

Thanks again for your reply.

That is because runing modal dialog disable document activation and you have to enable activation just before switching documents.