CAD VCL是一个高品质多功能且含源码的控件,它提供了几个强大的类用于为您的Delphi/C++Builder应用程序创建AutoCAD DXF, CGM, Hewlett-Packard PLT/HPGL, PDF和SVG文件。
CAD VCL的特性:
- 直接以AutoCAD DXF,Hewlett-Packard PLT/HPGL,CGM,PDF和SVG文件格式输出
- 与Borland Delphi和C++ Builder(从6到2010版本)完全兼容
- 支持Unicode
- 提供源代码
CADSoftTools——CAD VCL常见问题解答
Q1:是否能展示一个爆炸方块的代码?
A:您将在下面找到所需的示例代码:
interface uses ..., CADImage, DXFConv, sgFunction, sgConsts; ... implementation {$R *.dfm} procedure ExplodeInsert(ACADImage: TsgCADImage; AInsert: TsgDXFInsert); var I, J: Integer; vBlockEnt: TsgDXFEntity; vDXFInsert: TsgDXFInsert; vDXFLine: TsgDXFLine; vDXFLWPolyline: TsgDXFPolyline; vDXFCircle: TsgDXFCircle; vMatrix: TFMatrix; vPoint, vScale, vExtrusion: TFPoint; vAngle: Double; begin vMatrix := AInsert.GetMatrix; // Iterate through entities in the block for I := 0 to AInsert.Block.Count - 1 do begin vBlockEnt := AInsert.Block.Entities[I]; case vBlockEnt.EntType of ceLine: // LINE entity begin // Create a copy of the entity which is inside the block vDXFLine := TsgDXFLine.Create; vDXFLine.AssignEntity(vBlockEnt); // Multiply coordinates of the created entity by the transformation matrix vDXFLine.Point := FPointXMat(vDXFLine.Point, vMatrix); vDXFLine.Point1 := FPointXMat(vDXFLine.Point1, vMatrix); ACADImage.Converter.Loads(vDXFLine); ACADImage.CurrentLayout.AddEntity(vDXFLine); end; ceLWPolyline: // LWPOLYLINE entity begin v