Trying to use VGCore.Curve.PutCurveInfo with C# but won't accept CurveElement[] as parameter1, error says needs System.Array, WTF?

According to the API documentation I should be able to pass as paramter1 to Curve.PutCurveInfo CurveElement[], this works as expected in CorelDRAW X6, but fails in CorelDRAW 2021.

Here is the code snippet in question:

CurveElement[] curveInfo = CorelDrawUtilities.GeometryToCurveInfo(cdrDoc, cdrUnit.cdrInch, pg);
shape.Curve.PutCurveInfo(ref curveInfo);

Parents
  • I put together a quick test:

                corel.CurveElement[] ce = new corel.CurveElement[4];
    
                ce[0].ElementType = corel.cdrCurveElementType.cdrElementStart;
                ce[0].PositionX = 0;
                ce[0].PositionY = 0;
                ce[1].ElementType = corel.cdrCurveElementType.cdrElementLine;
                ce[1].PositionX = 2;
                ce[1].PositionY = 0;
                ce[2].ElementType = corel.cdrCurveElementType.cdrElementLine;
                ce[2].PositionX = 1;
                ce[2].PositionY = 2;
                ce[3].ElementType = corel.cdrCurveElementType.cdrElementLine;
                ce[3].PositionX = 0;
                ce[3].PositionY = 0;
    
                corelApp.ActiveShape.Curve.PutCurveInfo(ce);
    

    And it worked fine for me with CorelDRAW 2021. So I would double check your CurveElement[] and make sure that it is coming for VGCore.

Reply Children