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

bug? set postion is inconsistent results

New Here ,
Sep 05, 2022 Sep 05, 2022

Copy link to clipboard

Copied

i used C# create script tool

 

double x = 719.222222222219;
double y = -49.370370370369528;
app.ActiveDocument.Selection[0].Position = new object[2] { x, y };

 

the file is https://oss.tlxfif.com/test.ai

 

thanks

🙂

 

version 2021

TOPICS
Bug , Scripting , SDK

Views

140

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
community guidelines
New Here ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

the question reason is 'clipping mask'

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
community guidelines
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

if Selection[0] is a clipped group then you'll have to find the Clipping Path, find its position, get the difference between clipping path position vs clipping group position and adjust accordingly. 

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
community guidelines
New Here ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

how to get X,Y ? pleeeeeeease...  

25976853bt3d_0-1662484355056.png

 

 

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
community guidelines
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

var left = selection[0].position[0];

var top = selection[0].position[1];

 

to get the Center coordinates, add half of the Width and half of the Height

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
community guidelines
New Here ,
Sep 07, 2022 Sep 07, 2022

Copy link to clipboard

Copied

if groupItem Clipped equal true 

get position  contain hidden path;

😞

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
community guidelines
Community Expert ,
Sep 07, 2022 Sep 07, 2022

Copy link to clipboard

Copied

if groupItem Clipped equal true

 

then, you'll have to loop through all pathItems inside the group and check for their "clipping" property. Once you find the pathItem with "clipping = true" then that's the clipping path (invisible path)

 

let me know if you any issues getting this code done, we'll help you if you get stuck

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
community guidelines
New Here ,
Sep 07, 2022 Sep 07, 2022

Copy link to clipboard

Copied

very thanks;

i am a chinese,english not good.

😞

 

25976853bt3d_0-1662565539978.png

 

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
community guidelines
New Here ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied

LATEST

help.....

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
community guidelines
New Here ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

or how to get center[x] and center[y]?

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