图像导出dwg格式出错?CAD VCL热门技术问答精选合集有你想要!

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值