Skip to main content

How to upgrade from 8.0 and earlier versions

If you used the previous versions of CAD VCL (8.0 and earlier), you may experience some issues concerning compatibility of your project and our library. This topic describes the possible compatibility issues and also shows how to solve them:

  1. The 'Invalid typecast' error message appears in line where access to point from the list (points of POLYLINE, SPLINE etc.) is implemented. This error message is issued due to certain changes in storing this type of data as a result of adding 64-bit support. Now we are using the TF2DPointList and TFPointList classes to maintain lists of points, instead of the TList class. The difference between them is that these classes store an array of points, not an array of pointers, like TList. For more information, see the List Classes.
Note

If you want to use the TList class to maintain lists of points, there is the function that converts an array of the TF2DPoint or TFPoint type values to the TList type value. For more information, see ConvertBaseListToList.

The difference between the previous versions and new ones (8.1 and later) in accessing point from the list is shown in the examples below.

Previous versions
var
vSpline: TsgDXFSpline absolute Sender;
vControl, vFit: TFPoint;

begin
vControl := PFPoint(vSpline.Controls[2])^;
vFit := PFPoint(vSpline.Fit[2])^;
end;
Version 8.1 and later
var
vSpline: TsgDXFSpline absolute Sender;
vControl, vFit: TFPoint;

begin
vControl := vSpline.Controls[2];
vFit := vSpline.Fit[2];
end;

Solution: You need to make the certain changes in your code, similar to those in the examples above.

  1. Error message appears in line where deleting the entity from TsgDXFConverter is implemented.

Solution: The entity need to be deleted from the layout where it has been added. For example: vCADImage.Layouts[0].PaperSpaceBlock.RemoveEntity(vEntity)or vCADImage.CurrentLayout.PaperSpaceBlock.RemoveEntity(vEntity).