How to create a Shape and also edit with points

Here is the document for reference to know in detail
edit points.zip (33.3 KB)

@tejas.patel
We can reproduce the issue by testing on the latest version v25.6 using the following sample code. The result file cannot edit points after adding free form.

//Create a new shape path
ShapePath shapePath = new ShapePath();
shapePath.MoveTo(60, 45);
shapePath.ArcTo(25, 25, 0, 270);
shapePath.Close();

shapePath.MoveTo(60, 20);
shapePath.LineTo(110, 70);
shapePath.LineTo(125, 155.5f);
shapePath.ArcTo(35.5f, 35.5f, 0, 270);
shapePath.Close();

shapePath.MoveTo(150, 45);
shapePath.ArcTo(25, 25, 0, 270);

//Create a new shape path
ShapePath shapePath1 = new ShapePath();
shapePath1.MoveTo(0, 0);
shapePath1.CubicBezierTo(48.24997f, 0.6844f,
            96.5f, -7.148871f,
            130, 11.517795f);
shapePath1.CubicBezierTo(163.5f, 30.18446f,
            182.24997f, 75.351f,
            201, 120.517795f);
shapePath1.MoveTo(150, 70);
shapePath1.ArcTo(25, 25, 0, 270);

Workbook workbook = new Workbook();

//add free form
workbook.Worksheets[0].Shapes.AddFreeform(1, 0, 1, 0, 300, 200, new ShapePath[] { shapePath, shapePath1 });

// Save the workbook
workbook.Save(filePath + "out_net.xlsx");

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-58671

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.

@John.He
Issue ID(s): CELLSNET-58671
when above issue is resolved and released ?

@tejas.patel,

Thank you for bringing this to our attention. We have just logged your ticket, and to ensure we address the issue thoroughly, we need some time to evaluate it first. While simpler issues are typically resolved within 5-7 days, more complex matters may take a few weeks or longer. Once we’ve completed our evaluation, we’ll provide you with an update or an estimated time frame. We appreciate your patience and understanding.

@tejas.patel
Your issue(CELLSNET-58671) has been resolved and the fixed functionality will be released with version 25.7.

@duojie.yang
Thank you for informing
Can you provide shape sample in in excel?

@tejas.patel,

We will check if we can provide you with a sample Excel file containing the editable shape generated by our internal fix. Rest assured, Aspose.Cells for .NET v25.7, which includes this fix, is scheduled for release in the first half of July. You will be notified as soon as the new version becomes available.

@tejas.patel
After updating to version v25.7, please use the following code to test.

//Create a new shape path
ShapePath shapePath = new ShapePath();
shapePath.MoveTo(60, 45);
shapePath.ArcTo(25, 25, 0, 270);
shapePath.Close();

shapePath.MoveTo(60, 20);
shapePath.LineTo(110, 70);
shapePath.LineTo(125, 155.5f);
shapePath.ArcTo(35.5f, 35.5f, 0, 270);
shapePath.Close();

shapePath.MoveTo(150, 45);
shapePath.ArcTo(25, 25, 0, 270);

int shapePathW = shapePath.WidthPixel;
int shapePathH = shapePath.HeightPixel;

//Create a new shape path
ShapePath shapePath1 = new ShapePath();
shapePath1.MoveTo(0, 0);
shapePath1.CubicBezierTo(48.24997f, 0.6844f,
            96.5f, -7.148871f,
            130, 11.517795f);
shapePath1.CubicBezierTo(163.5f, 30.18446f,
            182.24997f, 75.351f,
            201, 120.517795f);
shapePath1.MoveTo(150, 70);
shapePath1.ArcTo(25, 25, 0, 270);

Workbook workbook = new Workbook();

if (shapePath1.WidthPixel > shapePathW)
{
    shapePathW = shapePath1.WidthPixel;
}

if (shapePath1.HeightPixel > shapePathH)
{
    shapePathH = shapePath1.HeightPixel;
}

//add free form
workbook.Worksheets[0].Shapes.AddFreeform(1, 0, 1, 0, shapePathH, shapePathW, new ShapePath[] { shapePath, shapePath1 });

// Save the workbook
workbook.Save("out_net.xlsx");

Here is the resulting file generated using the latest function:
out_net.zip (7.1 KB)

1 Like

@amjad.sahi, @duojie.yang , @John.He
Once again Thank you for your help

@tejas.patel
Thank you for your feedback. You are welcome. If you have any questions, please feel free to contact us at any time.

1 Like

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