Highlighted

need a script to calculate raduis and create frame around shape

Community Beginner ,
Nov 21, 2020

Copy link to clipboard

Copied

I need a script that calculates the radius of a rectangle on the side, and creates a dotted pink square around a shape. Attached files

 

https://www.dropbox.com/sh/gcxlylnbhy5vop3/AAATBuzwS1EFLzLUBPyE999da?dl=0

 

 

TOPICS
Scripting

Views

186

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

need a script to calculate raduis and create frame around shape

Community Beginner ,
Nov 21, 2020

Copy link to clipboard

Copied

I need a script that calculates the radius of a rectangle on the side, and creates a dotted pink square around a shape. Attached files

 

https://www.dropbox.com/sh/gcxlylnbhy5vop3/AAATBuzwS1EFLzLUBPyE999da?dl=0

 

 

TOPICS
Scripting

Views

187

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
Nov 21, 2020 0
Most Valuable Participant ,
Nov 21, 2020

Copy link to clipboard

Copied

Do you really need a script for that? I don't think.

 

dashed_stroke.png

Save a graphic style and apply it to all objects.

 

dashed_stroke_01.png

If that works for you

have fun

😉

 

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
Reply
Loading...
Nov 21, 2020 0
Community Beginner ,
Nov 21, 2020

Copy link to clipboard

Copied

I asked to expand an existing script that I have attached because I do this thing many times a day. Nor did you refer to the fact that I need to calculate the radius. I would be grateful for the extension of the attached code.

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
Reply
Loading...
Nov 21, 2020 0
Adobe Community Professional ,
Nov 21, 2020

Copy link to clipboard

Copied

I would just ask the person who wrote the original script.

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
Reply
Loading...
Nov 21, 2020 0
Engaged ,
Nov 21, 2020

Copy link to clipboard

Copied

By "radius" of a rectangle, do you mean diagonal of a rectangle?  I'm not sure where the r. 3528 in your attached file comes from. 

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
Reply
Loading...
Nov 21, 2020 0
Advocate ,
Nov 22, 2020

Copy link to clipboard

Copied

He was referring to the corner radius. Only he just made a mistake in the decimal place > instead of "r. 3528" he mean "r 3.528"

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
Reply
Loading...
Nov 22, 2020 0
Most Valuable Participant ,
Nov 22, 2020

Copy link to clipboard

Copied

Hi @Tom Winkelmann,

I'm the same opinion.

-----------------------------------------------------------------

 

Hi @aviel222,

1)

What about your other threads? Are they resolved?

For example:

 

Script correction to measure width and height together 

-----------------------------------------------------------------

 

2)

@aviel222 wrote: "I asked to expand an existing script … Nor did you refer to the fact that I need to calculate the radius …."

We are users like you. And we want to help you!

"Don't bite the hand that feeds you."

 

I gave you a partial solution to the outline (no scripting) that doesn't take any time - once the graphic style has been created. We don't know anything about your project. I am so sorry this was not acceptable to you!

 

Here is a script snippet that does the same - it creates a dashed stroke for the selected path item:

// pathItem_dashed_Stroke.jsx
// select one pathItem before running this script snippet
// regards pixxxelschubser

var aDoc = app.activeDocument;
var aSel = aDoc.selection[0];
aSel.stroked = true;
// swatch with name "CMYK Magenta" should already exists in your document
aSel.strokeColor = aDoc.swatches.getByName("CMYK Magenta").color;
aSel.strokeDashes = [2.8346457];
aSel.strokeWidth = 2.8346457;

 

There is no error management and you should build it into the other script yourself.

-----------------------------------------------------------------

 

3)

I will not make any changes to the script without the permission of the author! Sorry.

In addition, "your" script shown is an outdated variant.

-----------------------------------------------------------------

 

4)

The calculation of rounding depends on so many factors in your documents and objects that it is impossible to even remotely predict how much time it will take. So I cannot help you on this point.

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
Reply
Loading...
Nov 22, 2020 0
Community Beginner ,
Nov 22, 2020

Copy link to clipboard

Copied

Thank you!!!

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
Reply
Loading...
Nov 22, 2020 0
Community Beginner ,
Nov 22, 2020

Copy link to clipboard

Copied

Why is it so complicated to calculate the radius of the corners of the rectangle?
(diagonal of a rectangle)

I do not mind paying you for it
But depends on how many.

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
Reply
Loading...
Nov 22, 2020 0
Community Beginner ,
Nov 22, 2020

Copy link to clipboard

Copied

"Round corners" 

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
Reply
Loading...
Nov 22, 2020 0
Community Beginner ,
Nov 22, 2020

Copy link to clipboard

Copied

I just meant "round corners"

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
Reply
Loading...
Nov 22, 2020 0
Engaged ,
Nov 22, 2020

Copy link to clipboard

Copied

Is this the radius we're talking about?  If so, it would seem that this is easy to calculate. 

 

 Untitled.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
Reply
Loading...
Nov 22, 2020 0
Community Beginner ,
Nov 22, 2020

Copy link to clipboard

Copied

Yes!!! Exactly 

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
Reply
Loading...
Nov 22, 2020 0
Most Valuable Participant ,
Nov 22, 2020

Copy link to clipboard

Copied

Hi @femkeblanco 

please identify the roundness and if so the radius of each corner.

 

aa9d.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
Reply
Loading...
Nov 22, 2020 1
Engaged ,
Nov 22, 2020

Copy link to clipboard

Copied

Hi @pixxxelschubser.  I take your point about roundness.  But since we seem to be talking about a "radius", I presume we are talking about a (all symmetric) circle with a (single) radius. 

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
Reply
Loading...
Nov 22, 2020 0
Most Valuable Participant ,
Nov 22, 2020

Copy link to clipboard

Copied

Experience shows that one can very rarely rely on such assumptions. Especially if someone asks without an exact detailed description: Can someone write a script for me.

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
Reply
Loading...
Nov 22, 2020 0
Engaged ,
Nov 22, 2020

Copy link to clipboard

Copied

I agree with your point:  detailed descriptions are critical. 

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
Reply
Loading...
Nov 22, 2020 0
Resources