• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to get rotation angle applied to a line segment?

Engaged ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

Hi All,

I am developing a C++ plugin for AI CC 2017. I need to get the rotation angle applied to a line segment.

I found this method in the AIRealMathSuite which might give what I need,

AIAPI void(* AIRealMathSuite::AIRealMatrixGetRotate) (const AIRealMatrix *m, AIReal *angle)

But for this I need the AIRealMatrix parameter which is the transformation matrix of the line segment.

I am not sure how to get that.

Any ideas where I might start on this?

Thanks!

TOPICS
SDK

Views

1.4K

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
community guidelines

correct answers 1 Correct answer

Engaged , Jul 11, 2018 Jul 11, 2018

Okay.. So, I was able to do it..

I was going through the Scripting forum to find some answers there, and I got a breakthrough..

AI adds a tag to an item if it has been rotated. The tag is 'BBAccumRotation'.

I used the object's dictionary to find the tag and get it's value. The value is stored as a string in radians.

Convert it to degrees and you get the rotation angle.

Votes

Translate

Translate
Adobe
Community Beginner ,
Jul 03, 2018 Jul 03, 2018

Copy link to clipboard

Copied

It seems that there is no way, to get it. I have similiar problem, trying to get rotation/transformation matrix of kGroupArt object. As documentation for AITransformArtSuite::TransformArt says:

  • Text art, raster art, and placed art objects have associated transformation matrices. Functions such as AIRasterSuite::GetRasterMatrix() in the related suites provide access to the matrices. TransformArt() does not use the associated matrix, but instead uses a matrix that you pass to the function.
  • Path art objects are simple collections of connected line segments, and do not have an associated transformation matrix. For these, you must use the TransformArt() function.

Votes

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
community guidelines
Advocate ,
Jul 04, 2018 Jul 04, 2018

Copy link to clipboard

Copied

What are you trying to achieve? Do you want to distinguish between when a user draws a horizontal line and rotates it 90 degrees and when they draw a vertical line? I don't think that is possible. When you rotate a line, Illustrator just moves the points, it doesn't store the original points and the rotation. If you want to know the angle of a line segment, you can work this out from the start and end points.

Votes

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
community guidelines
Engaged ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

I want to find if the user has transformed the line by rotating it. So, finding the angle through the coordinates won't be much useful to me.

I was going through the Scripting forum to find some answers there, and I got a breakthrough..

AI adds a tag to an item if it has been rotated. The tag is 'BBAccumRotation'.

I used the object's dictionary to find the tag and get it's value. The value is stored as a string in radians.

Convert it to degrees and you get the rotation angle.

Votes

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
community guidelines
Engaged ,
Jul 11, 2018 Jul 11, 2018

Copy link to clipboard

Copied

LATEST

Okay.. So, I was able to do it..

I was going through the Scripting forum to find some answers there, and I got a breakthrough..

AI adds a tag to an item if it has been rotated. The tag is 'BBAccumRotation'.

I used the object's dictionary to find the tag and get it's value. The value is stored as a string in radians.

Convert it to degrees and you get the rotation angle.

Votes

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
community guidelines