Highlighted

Determine the rotation of a pageItem?

Engaged ,
Jul 17, 2020

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?

Adobe Community Professional
Correct answer by CarlosCanto | Adobe Community Professional

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

https://community.adobe.com/t5/illustrator/how-to-get-the-angle-of-an-object/m-p/8803169?cid=101&cgid=18269&page=1#M36513

Topics

Scripting

Views

59

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Determine the rotation of a pageItem?

Engaged ,
Jul 17, 2020

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?

Adobe Community Professional
Correct answer by CarlosCanto | Adobe Community Professional

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

https://community.adobe.com/t5/illustrator/how-to-get-the-angle-of-an-object/m-p/8803169?cid=101&cgid=18269&page=1#M36513

Topics

Scripting

Views

60

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Jul 17, 2020

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

https://community.adobe.com/t5/illustrator/how-to-get-the-angle-of-an-object/m-p/8803169?cid=101&cgi...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Engaged ,
Jul 17, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Jul 17, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Engaged ,
Jul 17, 2020

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Jul 17, 2020

Copy link to clipboard

Copied

I am referring to getting the angle information when the file is open in Illustrator.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...