I have a requirement of reflecting art(s) in the same manner as reflect-x in Effect->Distort and Transform->Transform. So far I have managed to reflect the art(s) using action manager.
The difference between both the methods is that in the former method there is a single resultant art object, whereas, in the latter method two art objects are created.
How can I use action manager or any similar method to get the result same as that in applying reflect-x from Effect menu?
Looking forward to your suggestion.
If you just want to reflect art,do it with the AITransformArtSuite. Reflect is simple operation that can be easily expressed as a matrix. the TransformArt suite lets you apply a matrix to artwork. So build yourself a reflection matrix, then apply it. No need for the action manager!
Thanks for the reply.
I have tried it as you mentioned. My requirement is such that I need to reflect the copy, so I duplicate the art and then apply tranformation. But there is still the same problem - Two art objects will be there after reflection.
Reflecting the arts is not the issue, problem is the way the art is reflected.
To make it clear let me explain the problem. Try this,
-> Create a shape/art on document.
-> Double click on "Reflect Tool" (in Tool panel). A dialog will appear.
-> Select Vertical/ Horizontal or enter value of angle.
-> Click copy.
You will see the two different arts ( one is reflected and the other is original). You can select/delete/edit any of them. They are like two different arts.
Now try this,
-> Create a shape/art on document.
-> Click on Effects->Distort & Tranform->Tranform. A dialog will appear.
-> Just check the "Reflect x" and enter "1" in copies. Click ok.
You will see only a single art having both original and reflected, combined together.
Using API either action mangar or transform suite + duplicate art, the result produced is same as mentioned in first case.
What I wanted is to produce result as mentioned in second case. i.e both art (original and reflected) should be combined together as a single art.
Oh, well that should still be easy. Just copy the art (AIArtSuite::DuplicateArt()) and then use the AITransformSuite on it to reflect it. If you want to combine them, it depends on the art type. You can group any two things together, so that's one option. Or if its a path, you can create a compound path and combine them that way. Is the source art always going to be a path? Or can it be any kind of artwork?
It can be any kind of artwork.
If I group the arts ( original and reflected), any of them can be ungrouped and edited. So a new problem will arise If you edit one of the arts (lets say apply any color or change its geometry) so it will be hard to update the other one.
I think I have to apply effect using API. I looked into the live effect suite, but, I see that the ExecuteLiveEffect method is not implemented.
Is there any way with which I can apply effect?
Ah, so what you're really looking for is the ability to apply a Live Effect to art? That is something I can help you with, though I'll have to brush up on my effect application code. I posted the code for a plugin that lets you debug a variety of things in Illustrator, one of which is the ability to see the name & parameters of a live effect. I can do that for you in the short term but you might consider grabbing that, since it might useful in the future
Here are the dictionary entries for a reflection (with parameters you can probably guess):
Effect name: "Adobe Transform"
+ transformPatterns [ "Boolean" ] = false
+ rotate_Degrees [ "Real" ] = 0
+ scaleH_Percent [ "Real" ] = 100
+ pinPoint [ "Integer" ] = 4
+ randomize [ "Boolean" ] = false
+ rotate_Radians [ "Real" ] = 0
+ scaleV_Factor [ "Real" ] = 1
+ reflectY [ "Boolean" ] = true
+ scaleLines [ "Boolean" ] = true
+ scaleV_Percent [ "Real" ] = 100
+ moveH_Pts [ "Real" ] = 0
+ scaleH_Factor [ "Real" ] = 1
+ numCopies [ "Integer" ] = 2
+ moveV_Pts [ "Real" ] = -110
+ reflectX [ "Boolean" ] = false
+ transformObjects [ "Boolean" ] = true
You can read up on how to use this information to apply it without PlayAction here: http://forums.adobe.com/thread/925871?tstart=0
P.S. Telling it to do two copies seems to make the original art stay visible. If you do one copy, the original is there, it just not rendered (you can still click on where it would be and get its selection box).