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

Script: Select objects, that are overlapping a specific object

New Here ,
Sep 13, 2019 Sep 13, 2019

Hi there, following problem:

i have several paths and designs and images, laying over a polyline-path "front part" or "back part" ...

 

If the objects and paths would lay inside the path "front part", it would be easy to select all of them with 

pageItems.getByName("front part");

 

But because, the designobjects are not laying as a child-item inside the path, I need to select them by comparing the positions.

item = pageItems.getByName("front part");

position = item.position 

itemwidth = item.width;

itemheight = ...

 

So i have a cut-layer with sublayers. If i want to choose "part-1", every path in other layers shall be selected. 

example.jpgexpand image

 

Next problem would be, that the source-path is not rectangular. If i'd define the corners of the item to check, if an object is laying inside the four corners of the source, it could be, that its not laying inside the path.

 

Any idea, how to do that propperly? Or is there another way to solve?

If its not solveable, i think, i have to move every designobject inside the source-layer.

 

---

 

TOPICS
Scripting
1.1K
Translate
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
Adobe
Community Expert ,
Sep 13, 2019 Sep 13, 2019

can you show some screen shots?

Translate
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 19, 2019 Sep 19, 2019

I added a screenshot of a layer. There are sublayers with polylines, which defines our print paths.

Now if i want to have all design elements, images, texts inside the part (which are all on a different layer)

i choose "PART-1" and want, that all design elements, which are positioned inside this element, is being selected.

Translate
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 23, 2019 Sep 23, 2019
LATEST

there might be a mathematical way of finding out if a path is inside of a non-rectangular shape. I don't have such a library, and I'm not sure it already exist. You'll have to try to look for a javascript library or build your own.

 

one work around that might be worth trying is to select your items as well as your non-rectangular shape and applying Unite Pathfinder. All paths fully inside your non-rectangular shape will disappear. Paths partially inside will be cut by the non-rectangular shape. All complete remaining shapes are outside of the non-rectangular area.

Translate
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