how to coding :) [get Clipping Mask visible bounds]

New Here ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

25976853bt3d_0-1662565539978.png

 

TOPICS
Scripting

Views

103

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
Advisor ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

Are you trying to read the position of the green path?  Or are you trying to set the position of the group so that the position of the green path is, for example, (0, 0)? 

 

Assuming your hierarchy is this:

  • group (selection 0)
    • group, clipped (selection 0.group 0)
      • red path (selection 0.group 0.path 0)
      • yellow path (selection 0.group 0.path 1)
    • green path (selection 0.path 0)

 

To read the position of the green path:

alert(app.selection[0].pathItems[0].position);

 

To set the position of the group so that the position of the green path is, for example, (0, 0):

var X = app.selection[0].pathItems[0].position[0] - app.selection[0].position[0];
app.selection[0].position = [0 - X, 0];

 

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 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

set the position of the group to (0,0)

get position.x => -133 😞

i need 

 

set the position of the group to (0,0)

get position.x => 0

get position.y => 0

🙂

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
Advisor ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

LATEST

@冯25976853bt3d  Rather than repeat the question, you need to clarify the question and the premises that underlie the question. 

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 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

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