2

When adding a ROUNDED_RECTANGLE on slides, by using pptx, I have below lines and a slide generated.

from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE
from pptx.util import Inches

prs = Presentation()
title_only_slide_layout = prs.slide_layouts[0]
slide = prs.slides.add_slide(title_only_slide_layout)
shapes = slide.shapes

shape = shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Inches(1), Inches(0.5), Inches(8), Inches(2))

prs.save('c:\\PPT\\round rectangle.pptx')

If it's manual, the rounded angle can be adjusted (where the red arrow pointing).

Is there a way to control it from the script? Thank you.

enter image description here

xaxxon
  • 19,189
  • 5
  • 50
  • 80
Mark K
  • 8,767
  • 14
  • 58
  • 118

1 Answers1

5

Shapes like this have one or more .Adjustments properties.

You need to modify .Adjustments(1) which can take values between 0 and 1 as I recall. A value of .5, for example, will move the yellow adjustment diamond .5 of the distance between the corner and the midpoint of the shape.

Steve Rindsberg
  • 14,442
  • 1
  • 29
  • 34
  • 1
    The key part of the docs for this is here: https://python-pptx.readthedocs.io/en/latest/user/autoshapes.html#adjusting-an-autoshape – scanny Aug 16 '18 at 18:09