Copy link to clipboard
Copied
Hi all, am I right in thinking that in Illustrator, there's no way to determine the rotated angle of a pageItem? Specifically not wanting to rotate this object, but read what rotation a user has done prior to the script running? I thought I might be able to get this from exporting as SVG since it applies the transform attribute but notice the path vertices seem hard-coded the minute you rotate something and export. Is this always the case or is there some trick to accessing a transform/rotation matrix of a given pageItem or pathItem?
you are right, it's not possible generally speaking.
For a particular scenario where the user is expected to rotate an object, then there is one or maybe two methods. When a user rotates an object, Illustrator adds a tag to that object with the rotated angle. We can read the value of the tag and use it as needed.
Here's a great read about it
Copy link to clipboard
Copied
you are right, it's not possible generally speaking.
For a particular scenario where the user is expected to rotate an object, then there is one or maybe two methods. When a user rotates an object, Illustrator adds a tag to that object with the rotated angle. We can read the value of the tag and use it as needed.
Here's a great read about it
Copy link to clipboard
Copied
Hmm, definitely some promising code in here. Unfortunately I'm in the same boat as Loic with needing it to be used on PathItems, and the content of this will be dynamic (not created by myself) so I'm unsure if I would be able to account for any given content, especially since the bounding box is always upright and doesn't rotate alongside the object like in a lot of other programs. I'll ask about this though.
Thanks regardless Carlos! Always extremely helpful.
Copy link to clipboard
Copied
In older versions of Illustrator that used to be the case. In the more current versions, it depends. If the object was created in Illustrator, or if it was File > Place in Illustrator, you should be able to select it and see the rotated angle. If it was pasted into Illustrator, then Illustrator doesn't seem to remember rotated angles.
Copy link to clipboard
Copied
Hi, this has the tag Scripting and is meant to be specifically in terms of the Scripting API. You're not talking about programmatically reading the angle from code, correct? Just in a general user standpoint of using the app, only as a normal user?
Copy link to clipboard
Copied
I am referring to getting the angle information when the file is open in Illustrator.