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

Script to convert shape rounded rectangle to rectangle

New Here ,
May 15, 2023 May 15, 2023

Copy link to clipboard

Copied

I hope the JavaScript implementation

thank!

圆角转直角.jpg

TOPICS
How-to , Scripting

Views

389

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

correct answers 1 Correct answer

Engaged , May 15, 2023 May 15, 2023

If you wish to create or modify a rectangle with rounded corners, you will have to add/remove the extra path points and set their Bezier handles yourself.

 

https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints.html

 

That is how the corner rounding options in Properties panel really does it, which you can check:

 

alert(app.activeDocument.pathItems[0].pathPoints.length)

 

Votes

Translate

Translate
New Here ,
May 16, 2023 May 16, 2023

Copy link to clipboard

Copied

Help Me please

Votes

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 ,
May 14, 2023 May 14, 2023

Copy link to clipboard

Copied

I hope the JavaScript implementation

thank!

圆角转直角.jpg

Votes

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
Engaged ,
May 15, 2023 May 15, 2023

Copy link to clipboard

Copied

If you wish to create or modify a rectangle with rounded corners, you will have to add/remove the extra path points and set their Bezier handles yourself.

 

https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints.html

 

That is how the corner rounding options in Properties panel really does it, which you can check:

 

alert(app.activeDocument.pathItems[0].pathPoints.length)

 

Votes

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 ,
May 16, 2023 May 16, 2023

Copy link to clipboard

Copied

Help Me please

Votes

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
Advocate ,
May 17, 2023 May 17, 2023

Copy link to clipboard

Copied

LATEST

Essayez cela...

// JavaScript Document for Illustrator
var docRef = app.activeDocument,
    objetSelect = selection[0],
    rects = objetSelect.geometricBounds,
    propRects = prop(rects),
    larg = propRects[0],
    haut = propRects[1],
     objetRect = docRef.pathItems.rectangle(rects[1],rects[0],larg,haut);
    objetSelect.remove();
// -------
function prop(Bounds) {return [Bounds[2]-Bounds[0],Bounds[1]-Bounds[3]];}
// -------

Votes

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