急求AUTOCAD数据读取,以及AUTOCAD的图形比较 有个客户想要以下功能,1、将AUTOCAD中的数据读取出来2、对两张AUTOCAD图进行比较,将不同的地方用颜色表示分不够可以再给,如果哪位兄弟能帮忙搞定,我就把我自己做的一些控件免费奉上。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是我自己一个控件中的源代码,你可以看看,主要是通过ole控制procedure Tmydbgrid.chooseexcel(sender: tobject);var msexcel, sheet: OleVariant; count, i: integer; //fieldnum, Grid: twwdbgrid;begin grid := self; if grid.DataSource.DataSet.Active = false then begin prompt(mtinformation, '数据为空!'); exit; end; try msexcel := CreateOleObject('excel.Application'); msexcel.visible := true; except prompt(mtinformation, '不能启动Microsoft Excel,操作失败!'); exit; end; count := 2; msexcel.Workbooks.Add(emptyparam); msexcel.Workbooks[1].WorkSheets[1].Name := 'Excel'; sheet := msexcel.Workbooks[1].WorkSheets['Excel']; for i := 1 to grid.FieldCount do begin if grid.UseTFields then sheet.cells[1, i] := grid.datasource.dataset.fields[i - 1].DisplayLabel else sheet.cells[1, i] := grid.Columns[i - 1].DisplayLabel; end; try grid.DataSource.DataSet.DisableControls; grid.DataSource.DataSet.First; while not grid.DataSource.DataSet.Eof do begin for i := 1 to grid.FieldCount do sheet.cells[count, i] := grid.Fields[i - 1].asstring; inc(count); grid.DataSource.DataSet.Next; end; grid.DataSource.DataSet.First; finally grid.DataSource.DataSet.EnableControls; end;end; MessageBox用法 对齐方式 关于NTDLL.DLL出错的奇怪问题 关于报表 Delphi byte[]转换为int 日期转换 在我的代码中已经写了imgEdit1.zoom:=10,为什么扫出的图形还是很大呢? 如何将汉字转化为ASCII码 急:如何用TFileStream和Tmemorystream读写流 版主,论坛浏览有问题!!!!!!!!!!!!!!!!! 请问在一个函数中可以再定义一个函数吗? 高分求解一个打印报表的问题(郁闷很久了),也可到报表区回答,都给分! 为什么这一段代码不对?
procedure Tmydbgrid.chooseexcel(sender: tobject);
var
msexcel, sheet: OleVariant;
count, i: integer; //fieldnum,
Grid: twwdbgrid;
begin
grid := self;
if grid.DataSource.DataSet.Active = false then
begin
prompt(mtinformation, '数据为空!');
exit;
end;
try
msexcel := CreateOleObject('excel.Application');
msexcel.visible := true;
except
prompt(mtinformation, '不能启动Microsoft Excel,操作失败!');
exit;
end;
count := 2;
msexcel.Workbooks.Add(emptyparam);
msexcel.Workbooks[1].WorkSheets[1].Name := 'Excel';
sheet := msexcel.Workbooks[1].WorkSheets['Excel'];
for i := 1 to grid.FieldCount do
begin
if grid.UseTFields then
sheet.cells[1, i] := grid.datasource.dataset.fields[i - 1].DisplayLabel
else
sheet.cells[1, i] := grid.Columns[i - 1].DisplayLabel;
end;
try
grid.DataSource.DataSet.DisableControls;
grid.DataSource.DataSet.First;
while not grid.DataSource.DataSet.Eof do
begin
for i := 1 to grid.FieldCount do
sheet.cells[count, i] := grid.Fields[i - 1].asstring;
inc(count);
grid.DataSource.DataSet.Next;
end;
grid.DataSource.DataSet.First;
finally
grid.DataSource.DataSet.EnableControls;
end;
end;