Find and replace shapes at different rotations.

New Here ,
Nov 25, 2020

Copy link to clipboard

Copied

I have a task that requires that I take hundreds of rounded triangles and replace them with regular triangles. The sizes are all the same, but the rotations change. Select > Same works to select all of the associated triangles, but is there a method for putting each triangle in at the right location and rotation automatically?

TOPICS
Draw and design, How to

Views

101

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Adobe Community Professional , Nov 26, 2020
Kurt Gold Adobe Community Professional , Nov 26, 2020
You can download and unzip the file below:   https://drive.google.com/file/d/1eY8AVXNryBsMrcagIpaMpvBw9V9xb_Yg/view?usp=sharing   It contains a sample Illustrator file (no_triangles.ai) that is using the objects you provided in your sample and it contains an action file (closed_triangle_maker.aia).   Instructions:   In the Actions palette flyout menu, load the action set "closed_triangle_maker.aia" Open the file "no_triangles.ai" Select all and start the action in the Actions palette  

Likes

Translate

Translate
Jump to answer Jump to answer
Most Valuable Participant ,
Nov 25, 2020

Copy link to clipboard

Copied

defaulty,

 

I imagine that the actual change from rounded triangle to sharp triangle through a script could be the key to a script solution.

 

Obviously, it is crucial to know whether the former kind is an ordinary/expanded rounded triangle with two Anchor Points at each corner or live.

 

With that information I hope one/some of our scripter friends might take a look.

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 25, 2020

Copy link to clipboard

Copied

triangles1-01.jpg

Unfortunately, they are kind of jagged and compressed, but still vector outlines. Circled triangle is what I want them to look like.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Nov 25, 2020

Copy link to clipboard

Copied

Are they live shapes?

Or just paths?

 

If they are live shapes, in the transform panel just set the corner rounding to 0

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 25, 2020

Copy link to clipboard

Copied

They are paths, unfortunately.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Nov 25, 2020

Copy link to clipboard

Copied

Can you convert them to shapes via Object >Shape>Convert to shape?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 25, 2020

Copy link to clipboard

Copied

It replies with "7/7 objects not converted."

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Nov 26, 2020

Copy link to clipboard

Copied

default,

 

As far as I can see, you can do it for all rounded triangles in one go using a combination of two existing scripts, and then a bit. I can only give you the name and link for one of them, but I am sure someone can supply those for the other one.

 

And someone can collect the rest of the steps into a third script (everything could be collected into one script, but I believe that would be inappropriate.

 

The following steps can be used:

 

0) If needed: lock other paths if any, such as the sharp triangle in your screenshot;

1) Ctrl/Cmd+A to select everything and apply the Cut at Selected Anchors script, see link below, then Ctrl/Cmd+A again;

Now you have open paths of everything;

2) Deselect (you can click an empty spot on the Artboard) and apply the other script, which selects paths that are shorter than a certain length (choose a length that is shorter than the side length but longer than the length of the rounding), then delete these short paths;

The rest

3) Ctrl/Cmd+A, then Object Transform>Transform Each> Scale both vertically and horizontally by a sufficient % such as 120% (so that the straight paths (former segments) cross for each triangle but no crossing with other triangles, the % depends on the rounding;

4) Ctrl/Cmd+A and Pathfinder>Divide, then Shift+Ctrl/Cmd+G to Ungroup;

5) If needed: unlock any locked paths (no harm in doing that even if there is none).

 

3) - 5) can be done with the third script.

 

The Cut at Selected Anchors script is in this free bundle of scripts (by 佐藤浩之, Satō Hiroyuki),
http://shspage.com/aijs/en/

Can someone supply the other script?

 

Can someone create the third script?

 

There may be other ways.

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Nov 26, 2020

Copy link to clipboard

Copied

Which version of Illustrator are you using?

 

Also, can you share this Illustrator file (.ai)?

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 26, 2020

Copy link to clipboard

Copied

https://www.dropbox.com/s/xir3peffaztxkq1/triangles.ai?dl=0
While I cant provide the Ai itself, I can share a few sample triangles, including a triangle I want to replace them with.

I am using the most recent CC

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Nov 26, 2020

Copy link to clipboard

Copied

It can (mostly) be done with an action.

 

Some further questions:

 

  • In your sample file the "triangles" are not closed paths. Is that always the case?
  • Are the dimensions of the "triangles" always similar to the ones in your sample file?

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 26, 2020

Copy link to clipboard

Copied

They are always vaugly triangular shapes made up of three closed paths, generally one angle and one side.

There are other triangles, but they are all of uniform sizes.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Nov 26, 2020

Copy link to clipboard

Copied

You can download and unzip the file below:

 

https://drive.google.com/file/d/1eY8AVXNryBsMrcagIpaMpvBw9V9xb_Yg/view?usp=sharing

 

It contains a sample Illustrator file (no_triangles.ai) that is using the objects you provided in your sample and it contains an action file (closed_triangle_maker.aia).

 

Instructions:

 

  • In the Actions palette flyout menu, load the action set "closed_triangle_maker.aia"
  • Open the file "no_triangles.ai"
  • Select all and start the action in the Actions palette

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more