Skip to main content
ss92139721
Participating Frequently
February 16, 2021
Answered

How to get rotated attributes

  • February 16, 2021
  • 6 replies
  • 1375 views

For example, the above red line mark ,how to use API to get it

This topic has been closed for replies.
Correct answer Rick E Johnson

I had done several tests regarding getting and setting accumulated rotations and summarized my findings in a post on this forum. Unfortunately, since Adobe changed the software for this forum, I've not been able to search for that post and other related discussions. I have some comments in my code, though, that may prove helpful, that I'll share with you.

 

I found that simply reading tags with the AITagSuite would sometimes cause a crash, so I ended up using dictionary entries instead. I use Hot Door's CORE, which directly supports dictionaries, so my code is a bit simpler than the SDK's.

 

bool success = tempArt->dictionary()->getStringEntry("BBAccumRotation", rotStr); 
// now convert rotStr to a number

 

The string in a dictionary or tag can contain up to 16 decimal places, but I use 8 because 16 will crash Illustrator's Free Transform tool.

 

Illustrator's Properties panel doesn't seem to work the same way the Info panel does. I don't have notes on exactly what is different -- I think that info is in my lost forum post.

 

When getting the rotation of a group, I look at the rotation of the topmost object within the group.

 

I hope this is helpful.

6 replies

pixxxelschubser
Community Expert
Community Expert
February 16, 2021
Rick E Johnson
Inspiring
February 16, 2021

Great! I see if I search for "BBAccumRotation +sdk" it narrows it down much better.

 

Now people searching for info on BBAccumRotation with the SDK can find relevant info more easily!

 

Thanks!

Rick E Johnson
Inspiring
February 16, 2021

Awesome! But I can't find where to add the "in Illustrator" or "SDK" attributes.

pixxxelschubser
Community Expert
Community Expert
February 16, 2021

 

… Unfortunately, since Adobe changed the software for this forum, I've not been able to search for that post and other related discussions …

 

By @Rick E Johnson

 

Simple use the search with your keyword(s) on your profil site:

https://community.adobe.com/t5/forums/searchpage/tab/message?advanced=false&allow_punctuation=false&author_id=9179494&filter=authorId&q=rotation

Rick E Johnson
Inspiring
February 16, 2021

Thanks, that's some of them! I had also participated in conversations created by others. Is there a good way to search for older conversations regarding "rotation" that are ONLY in the SDK topic and ONLY for Illustrator? My searches seem to return a deluge of results that relate to neither Illustrator nor SDK. I'm sorry, this has gotten off topic.

Rick E Johnson
Rick E JohnsonCorrect answer
Inspiring
February 16, 2021

I had done several tests regarding getting and setting accumulated rotations and summarized my findings in a post on this forum. Unfortunately, since Adobe changed the software for this forum, I've not been able to search for that post and other related discussions. I have some comments in my code, though, that may prove helpful, that I'll share with you.

 

I found that simply reading tags with the AITagSuite would sometimes cause a crash, so I ended up using dictionary entries instead. I use Hot Door's CORE, which directly supports dictionaries, so my code is a bit simpler than the SDK's.

 

bool success = tempArt->dictionary()->getStringEntry("BBAccumRotation", rotStr); 
// now convert rotStr to a number

 

The string in a dictionary or tag can contain up to 16 decimal places, but I use 8 because 16 will crash Illustrator's Free Transform tool.

 

Illustrator's Properties panel doesn't seem to work the same way the Info panel does. I don't have notes on exactly what is different -- I think that info is in my lost forum post.

 

When getting the rotation of a group, I look at the rotation of the topmost object within the group.

 

I hope this is helpful.

Rick E Johnson
Inspiring
February 16, 2021

This doesn't relate directly to the original post, but despite having issues with tags using the SDK, using AppleScript I've been able to read and write BBAccumRotation tags quite reliably. That's been helpful for when I need a quick solution in minutes, rather than hours or days for a plugin.

pixxxelschubser
Community Expert
Community Expert
February 16, 2021

For which language?

The tag you should looking for is "BBAccumRotation"

 

for example:

How to get the angle of an object ? 

or

How to rotate a grouped artworks in the same way as Rotate Tool ? 

Inspiring
February 16, 2021

I don't want to hijack the OP's questions here, but I'm looking for a plugin SDK C++ solution. It does not seem like the most intuitive way to get a rotation value from an art object, but I will sure check out the AIDictionary suite. Thank you for the pointer. :^)

Inspiring
February 16, 2021

I would also like to know how to access this value. Please let me know if you find out.

(You would think this would belong to the AIArtSuite, but I can't find how to access the rotation value there.)