Skip to main content
TheDollarBill
Known Participant
January 16, 2015
Answered

AIPluginGroup vs. AIDictionaries

  • January 16, 2015
  • 1 reply
  • 427 views

I just learned about the AIPluginGroup.  I guess it allows you to group some of the art objects into a separate group that your plug in can deal with. More importantly, if I'm reading the docs right, it even has it's own notifiers so that you can see when art from your plugin group is modified?!  Wouldn't this be a better solution than trying to keep track of stuff manually by creating a dictionaries and running through all of the art yourself?  Or am I confused.  Enlighten me?

This topic has been closed for replies.
Correct answer A. Patterson

AIPluginGroup is basically 'custom art'. We use it in MAPublisher, and it can be very powerful. It also has many, many eccentricities, so be warned! If you ever used the old Pathfinder tools pre-CS6, it's output was in fact NOT a path (or group of paths) but one of these guys. That used to annoy us because it meant they were not treated as paths by anyone else, ever. You had to explode them to get the internals back.

AIPluginGroup is a very strange beast, so you should be very cautious when using this. Because it fully quarantines anything inside from the the rest of the artboard, it means the user can't use anything in AI on the art inside without you implementing it directly. This might be what you want though too!

In a nutshell, it has two groups: one is what's drawn, and the other is what's clickable. So for a simple example, you could put a circle in the draw group, then get its bounds and draw a path of that bounds in the edit group. THat would mean clicking on the circle would have no effect, but clicking around the outside would (the square bounds would NOT be visible). So in this case, if you wanted the circle to be clickable (i.e. to select the WHOLE plugin group, there is no sub-selection I believe) you'd have to draw the circle to both groups.

It does let you 'refuse' to do certain things, at least in theory. In practice, they didn't fully close that so while it will prevent some of it, you still have to keep an eye out for certain operations (rotate, etc.) that might be applied to your AIPluginGroup without going through the request channel. The only good thing there is that nothing can ever happen without coming through some kind of method, because Illustrator is basically saying "you handle all the art chores". That also means that if you want your art to rotate, when you get that request, you have to take the rotation and apply it to your art yourself.

It's worth playing around with, and there may be situations that this would be helpful, but it is NOT a silver bullet for the 'what actually happened?!' problem.

1 reply

A. Patterson
A. PattersonCorrect answer
Inspiring
January 16, 2015

AIPluginGroup is basically 'custom art'. We use it in MAPublisher, and it can be very powerful. It also has many, many eccentricities, so be warned! If you ever used the old Pathfinder tools pre-CS6, it's output was in fact NOT a path (or group of paths) but one of these guys. That used to annoy us because it meant they were not treated as paths by anyone else, ever. You had to explode them to get the internals back.

AIPluginGroup is a very strange beast, so you should be very cautious when using this. Because it fully quarantines anything inside from the the rest of the artboard, it means the user can't use anything in AI on the art inside without you implementing it directly. This might be what you want though too!

In a nutshell, it has two groups: one is what's drawn, and the other is what's clickable. So for a simple example, you could put a circle in the draw group, then get its bounds and draw a path of that bounds in the edit group. THat would mean clicking on the circle would have no effect, but clicking around the outside would (the square bounds would NOT be visible). So in this case, if you wanted the circle to be clickable (i.e. to select the WHOLE plugin group, there is no sub-selection I believe) you'd have to draw the circle to both groups.

It does let you 'refuse' to do certain things, at least in theory. In practice, they didn't fully close that so while it will prevent some of it, you still have to keep an eye out for certain operations (rotate, etc.) that might be applied to your AIPluginGroup without going through the request channel. The only good thing there is that nothing can ever happen without coming through some kind of method, because Illustrator is basically saying "you handle all the art chores". That also means that if you want your art to rotate, when you get that request, you have to take the rotation and apply it to your art yourself.

It's worth playing around with, and there may be situations that this would be helpful, but it is NOT a silver bullet for the 'what actually happened?!' problem.