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

Script to convert shape rounded rectangle to rectangle

New Here ,
May 15, 2023 May 15, 2023

I hope the JavaScript implementation

thank!

圆角转直角.jpg

TOPICS
How-to , 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

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)

 

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

Help Me please

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

I hope the JavaScript implementation

thank!

圆角转直角.jpg

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
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)

 

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

Help Me please

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
Advocate ,
May 17, 2023 May 17, 2023
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]];}
// -------
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