We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Grouping doesn't appear to take shape rotation into account

I am creating a group of existing shapes.
When I create the group the size of the group is based on the size of the shapes without taking into account their rotation.
When I do the same thing in the Visio, the size of the group encompasses all the shapes based on their rotation.
The attached sample shows a source.vsdx and then an a copy where the shapes are grouped by Visio and second where the shapes are grouped by Diagram. The attached also includes the solution that was used to create the group programmatically.

Hi Greg,


Thank you for contacting support. We managed to replicate the problem of incorrect calculation of shape’s height. It has been logged under ticket ID DIAGRAMNET-51155 in our bug tracking system. Your post has also been linked to this ticket. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.

As a workaround, you can calculate height of the final group shape, and then set it before saving in the VSDX format.

vertical distance of center points = (PinY of Shape ID 239) - (PinY of Shape ID 275)
// taking width value from shapesheet of shape ID 239 because it is rotated (angle: -90)
GroupShapeHeight = (vertical distance of center points) + (Width of Shape ID 239)/2 + (Height of Shape ID 275)/2

//Group the Shapes
Shape theGroupShape = curPage.Shapes.Group(groupShapes);
// set height
theGroupShape.SetHeight(GroupShapeHeight);
// save diagram in the VSDX format
theDiagram.Save(args[2], SaveFileFormat.VSDX);

Please also refer to these help topics: Setting Height and Width of a Shape, Rotate a Shape with Suitable Angle and Get PinX and PinY Values of a Shape

Hi Greg,


Thank you for being patient. We have a good news for you that the ticket ID DIAGRAMNET-51155 has now been resolved. If there is no issue in the QA phase, then this fix will be included in the next version 17.03.0 of Aspose.Diagram for .NET API. We’ll inform you via this forum thread as soon as the new release is published.

The issues you have found earlier (filed as DIAGRAMNET-51155) have been fixed in Aspose.Diagram for .NET 17.3.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.