NotPrimitive shape need to resize when resize from excel

EXCEL CONFIRMATION.zip (8.5 KB)

@tejas.patel,

Thanks for the sample file with code snippet inside it.

I checked the shape and code snippet a bit. It seems shape is locked somehow for resizing. You need to ensure shape geometry allows resizing. For example, you may try to set IsLocked and IsAspectRatioLocked Boolean attributes to false. Also, you may set SetLockedProperty() for the Shape for your requirements. We will evaluate your code snippet thoroughly and may advise you some tweak for your task.

i have implemented above solution but not working can you please give me full code snippet?

@tejas.patel
After looking into the file, the width and height of ShapePath should be set too. We will check whether we should provide API for width and height.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-58623

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@tejas.patel,

This is to inform you that your issue (Ticket ID: “CELLSNET-58623”) has been resolved. The fix/enhancement will be included in the upcoming release (Aspose.Cells v25.7) that we plan to release in the first half of July 2025. You will be notified when the next version is published.

@amjad.sahi
Thank you

@tejas.patel,

You are welcome.

Keep in touch.

@amjad.sahi
Thank you for informing CELLSNET-58623
Can you provide shape sample in excel?

@tejas.patel
It’s the same issue as
How to create a Shape and also edit with points - #7 by amjad.sahi.
So you can check the attached file on that post.

@simon.zhao @amjad.sahi
Above is solved for below sample shape or other shape?

// Alc Line shape using custome point top to bottom

double pxToEmu = 72 / 96.0 * 12700;

Shape notPrimitiveShape = xlWorkSheet.Shapes.AddAutoShape(AutoShapeType.NotPrimitive, 0, 0, 0, 0, 0,0);

notPrimitiveShape.X = 400;
notPrimitiveShape.Y = 400;

int wi = -200; //px;
int he = 100; //px;
float diffH = 13.5F;

notPrimitiveShape.Fill.FillType = FillType.None;
CustomGeometry custom = (CustomGeometry)notPrimitiveShape.Geometry;
ShapePath p = (ShapePath)custom.Paths[custom.Paths.Add()];
ShapeSegmentPath pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.MoveTo)];
pathSegement.Points.Add(0, 0);

// the coordinate is [with*pxToEmu , height *pxToEmu ]
pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.LineTo)];
pathSegement.Points.Add(0, 0);
pathSegement.Points.Add(0, (int)(diffH * pxToEmu));

pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.LineTo)];
pathSegement.Points.Add(0, (int)(diffH * pxToEmu));
pathSegement.Points.Add((int)(wi * pxToEmu), (int)(diffH * pxToEmu));

pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.LineTo)];
pathSegement.Points.Add(0, (int)(diffH * pxToEmu));
pathSegement.Points.Add((int)(wi * pxToEmu), (int)(diffH * pxToEmu));

pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.LineTo)];		
pathSegement.Points.Add((int)(wi * pxToEmu), (int)(diffH * pxToEmu));
pathSegement.Points.Add((int)(wi * pxToEmu), (int)(he * pxToEmu));

when above solved change is released ? can you give me any approx date?
and also can you give me latest code sample?

@tejas.patel
We will release 25.7 in this week.

The issues you have found earlier (filed as CELLSNET-58623) have been fixed in this update. This message was posted using Bugs notification tool by leoluo

1 Like