Any Reason to stop using legacy Rectangles?

I like using legacy rectangles because the rounded corners are easy to work with in the API. I haven’t been able to figure out how to create a rounded rectangle via macros using non-legacy shapes.

In the API docs, there is no indication that there are plans for deprecation of the RectangleShape. However, these legacy shapes must have been abandoned for a reason. Am I foolish to still use them?

I have customized my drawing toolbars to include the legacy rectangle sub toolbar. I think there is no reason to not use them. Nevertheless, you should be aware, that the text box shape and the rounded rectangles from the category “Basic Shapes” as well have better features in regard to text content.

Setting the corner radius of the “new” rounded rectangle is more complex but not really difficult. When you look at such shape with the “Development Tools” you can see the location of the associated attribute:
tab Properties > CustomShapeGeometry > Find the item “AdjustmentValues” > Value.

Depending on whether it is our own rounded rectangle (type “rounded-rectangle”) or imported from pptx (type “ooxml-roundRect”) the adjustment value is relative to the range 0…21600 or the range 0…100000. In both cases the shorter edge of the rectangle is the reverence length.

In the Drawing toolbar, the Basic Shapes area offers both Rectangle, Rounded and Square, Rounded tools to draw rectangles or squares with rounded corners. These shapes come with a control point to alter the radius of the corners. You can right click and select Position and Size to open a dialog where you can precisely set the corner radius. While the top part of the Slant & Corner Radius tab is grayed out, you can use the x position of Control Point 1 to set the radius of the corners.

It’s true. Drawing a rounded rectangle manually is straightforward. But doing it with a macro is mysterious and poorly understood.

The newer “non legacy” shapes show up as a “Shape” in the bottom of the window when selected. In the API, they are “CustomShape”.

By contrast a legacy rectangle shows up as a “Rectangle” in the bottom of the window when selected. And if you add a CornerRadius in the Position/Size dialog, the description changes to “Rounded rectangle”.

To establish the rounded corners of a rectangle, only establish the CornerRadius property by creating it. You can also set it after creating it.

1 Like