Skip navigation
Currently Being Moderated

Fast way to change fill colour of many objects

Aug 9, 2012 5:04 PM

I am currently navigating the document model through all objects and manually adjusting the fill colour of desired objects.

 

For example, for each layer, I iterate through the GroupItems, CompoundPathItems, PathItems, in the GroupItems I navigate the GroupItems, CompoundPathItems, PathItems, etc.

 

In order to change all the colours of the objects, it ends up taking over a minute to accomplish.  But in the Illustrator UI, I can select a very complicated group item and change it's colour very fast.  In the SDK, GroupItem does not have a fill colour parameter, so I have to iterate through all sub-items to change the colour.

 

Is there a better way?  This seems so slow.

 

...Matt

 
Replies
  • Currently Being Moderated
    Aug 10, 2012 8:02 AM   in reply to mwhouser

    There is a method AIPathStyleSuite::AdjustObjectAIColors() which takes a callback for updating a colour. You can tell it to visit just fill colours only. I don't know what happens if you call that on a group though; does it find all the children with fill colours automatically? If not, you might be able to sue the AIArtSetSuite to get all the art of a particular type from a layer and then run AdjustObjectAIColors() on each?

     

    In genearl, if AI can do it, we can. Though it's not always obvious how

     
    |
    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