How to Ungroup a GroupShape in a PowerPoint Presentation in Python?

One more question. Is there any API that can ungroup a GroupShape?

@kkk123222,
Thank you for posting the question.

Unfortunately, Aspose.Slides for Python does not provide a single method for ungrouping GroupShape objects. But you can clone shapes from a group shape, add them to a slide, and delete the original group shape. The following code snippet shows you how to do this:

for shape in group_shape.shapes:
    slide.shapes.add_clone(shape)

slide.shapes.remove(group_shape)

add_clone does not work with custom shape. When I use it to clone custom shapes, the cloned shapes are different from the original ones.

@kkk123222,
We are sorry that you have to encounter this problem. Please share the following files and information:

  • sample presentation file with the custom shapes
  • output presentation file
  • Aspose.Slides version you used

Then we will investigate the case and help you.

test_pic_group2.zip (1.7 MB)

The slide 1 has a group shape including custom shape. I ungroup this group shape and add_clone to a new group shape in slide 2. The position is different. I also find out that if I set shape.x/shape.y value equals to a number with many decimal places, the property value will change. For example I set shape.x = 200.111222333444, then I check the value and it is 200.11117553710938.

Aspose.Slides version: 24.7.0

@kkk123222,
Thank you for the details. Unfortunately, I was unable to reproduce the problem you described. Could you kindly share the simplest code example to do this?

I fix the problem. Thank you anyway.

@kkk123222,
We are glad that the issue has been resolved on your end. Thank you for using Aspose.Slides.