Skip to main content
Participating Frequently
September 6, 2022
Question

bug? set postion is inconsistent results

  • September 6, 2022
  • 2 replies
  • 456 views

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

This topic has been closed for replies.

2 replies

CarlosCanto
Community Expert
Community Expert
September 6, 2022

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. 

Participating Frequently
September 6, 2022

how to get X,Y ? pleeeeeeease...  

 

 

CarlosCanto
Community Expert
Community Expert
September 7, 2022

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

Participating Frequently
September 6, 2022

the question reason is 'clipping mask'