Skip navigation
joshmonarck5
Currently Being Moderated

IsolationMode Check Problem

Jul 24, 2012 9:05 PM

Tags: #cs4 #illustrator #cs5 #cs3 #sdk #isolation_mode

I'm working on a plug-in that needs to check if the user is in isolation mode every time the layer list is changed.  My plug-in needs to keep track of the all of the layers, but the layer list changes when the user enters isolation mode (double-clicks an element) and this messes up my plug-in.  Here is my notifier method:

 

AIErr MyPlugin::LayerListChangedNotifier(AINotifierHandle notifier)

{

     ASErr error;

     AIDocumentHandle hCurrDoc = NULL;

     long docCount;

     AIIsolationModeSuite* sAIIsolationModeSuite = new AIIsolationModeSuite();

     bool IsInIsolationModeBoolean = sAIIsolationModeSuite->IsInIsolationMode();

 

     // Check if the user is in isolation mode.

     if (IsInIsolationModeBoolean == true)

     {

          // If in isolation mode.

          exit(1);

     }

     else

     {

          // If not in isolation mode.

          exit(2);

     }

     return(kNoErr);

}

 

I've tested this method with other random code and am sure that it gets called correctly.  It seems that with the code above, it seems to stop at:

bool IsInIsolationModeBoolean = sAIIsolationModeSuite->IsInIsolationMode();

 

Why would it stop at this point?  It doesn't exit out or anything, it just simply stops at that line.

Any ideas?

 

Thanks in advance

 
Replies
  • Currently Being Moderated
    Jul 25, 2012 6:58 AM   in reply to joshmonarck5

    This is just a stupid suggestion, but maybe throw an assert() on sAIIsolationModeSuite after its created, I assume you're running Windows -- I've never seen a Mac 'just stop', but I have seen Windows do that (no idea why). If hte sAIIsolationModeSuite is NULL after the new, I could see how that could cause it to die suddenly (even though you'd expect something more explicit). If not that, I'm not sure why else it would die there.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 26, 2012 7:40 AM   in reply to joshmonarck5

    Have you tried catching the kAIIsolationModeChangedNotifier? The description is a little silly (it talks about object focus) but I'd imagine it indicates if you're shifting into isolation mode (or, possibly, going from isolation on object A to isolation on object B, so be careful).

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 5, 2012 7:13 AM   in reply to joshmonarck5

    You may have done this, but didn't mention it -- you need to register for a notifier before it will be sent to you. That's done with AINotifierSuite::AddNotifier().

     

    As for the isoloation mode check, it may depend on how you're triggering that check. You might need an ApplicationContext object before you can perform that check, particularly if you're not doing it in direct response to some kind of caller/selector from Illustrator (i.e. a timer callback). You can't talk to the API without an ApplicationContext, though Illustrator does that for you if its in response to a caller/selector.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points