We already have X6 integrated into our product. I'm now trying to add X7 functionality, but I'm finding that calls to Layer.CreateCurve is throwing an exception.
Here's a quick sample in C#:
static void Main(string[] args)
{
VGCore.Application cdr = new VGCore.Application();
VGCore.Document doc = cdr.ActiveDocument;
doc.Unit = VGCore.cdrUnit.cdrCentimeter;
VGCore.Curve curve = cdr.CreateCurve(doc);
VGCore.SubPath spath = curve.CreateSubPath(6,6);
spath.AppendLineSegment(6, 3);
spath.AppendCurveSegment(3, 0, 2, 270, 2, 0);
spath.AppendLineSegment(0, 0);
spath.AppendLineSegment(0, 9);
spath.AppendLineSegment(3, 9);
spath.AppendCurveSegment(6, 6, 2, 0, 2, 90);
spath.Closed = true;
VGCore.Shape shape = doc.ActiveLayer.CreateCurve(curve);
}
the code work in vb.net, except Coreldraw X7 must be running. i get also an exception when i try to start corel with vb.net
Dim cdr As VGCore.Application = New VGCore.Application()
Dim doc As VGCore.Document = cdr.ActiveDocument
doc.Unit = VGCore.cdrUnit.cdrCentimeter
Dim curve As VGCore.Curve = cdr.CreateCurve(doc)
Dim spath As VGCore.SubPath = curve.CreateSubPath(6, 6)
spath.AppendLineSegment(6, 3)
spath.AppendCurveSegment(3, 0, 2, 270, 2, 0)
spath.AppendLineSegment(0, 0)
spath.AppendLineSegment(0, 9)
spath.AppendLineSegment(3, 9)
spath.AppendCurveSegment(6, 6, 2, 0, 2, 90)
spath.Closed = True
Dim shape As VGCore.Shape = doc.ActiveLayer.CreateCurve(curve)