社区
Delphi
帖子详情
delphi操作AutoCAD的问题
snakefire
2004-09-16 10:24:11
其实这个问题应该是autoCAD的问题,但是没有AutoCAD的板块,现在我是用delphi操作AutoCAD。。所只好到这里提问了,希望有AutoCAD开发经验的大虾们救命。。
autoCAD中,delphi操作怎么将块分解。。。Explode--是分解块的操作,但是我在调用Block时,
Block没有这个方法。
...全文
136
7
打赏
收藏
delphi操作AutoCAD的问题
其实这个问题应该是autoCAD的问题,但是没有AutoCAD的板块,现在我是用delphi操作AutoCAD。。所只好到这里提问了,希望有AutoCAD开发经验的大虾们救命。。 autoCAD中,delphi操作怎么将块分解。。。Explode--是分解块的操作,但是我在调用Block时, Block没有这个方法。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
i54
2004-10-21
打赏
举报
回复
UP
WhyAndAnswer
2004-10-21
打赏
举报
回复
学习
yijiansong
2004-09-17
打赏
举报
回复
学习
太空11
2004-09-17
打赏
举报
回复
给你点代码,可能对你能有点帮助。
unit AcadTest2000;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ActiveX, ComObj, OleCtnrs;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
p1, p2 : OleVariant;
Acad, ActiveDoc, : OleVariant;
begin
// create variant arrays to hold coordinates of the window
p1 := VarArrayCreate([0,2], VT_R8);
p2 := VarArrayCreate([0,2], VT_R8);
// assign values to array elements
p1[0] := 14330.0; p1[1] := 400.0; p1[2] := 0; //point (14330,400,0)
p2[0] := 26400.0; p2[1] := 8500.0; p2[2] := 0; //point (26400,8500,0)
Acad := CreateOleObject('AutoCad.Application');
if not varisempty(Acad) then
Acad.visible := visible;
// open drawing
ActiveDoc := Acad.Documents.Open('E:\Home\Planview.dwg');
// zoom appliciation
Acad.ZoomExtents;
Acad.ZoomWindow(VarArrayRef(p1),VarArrayRef(p2));
end;
end.
The Approach for Acad-14 is different. The ZoomExtents and ZoomWindow methods apply to a viewport, also the sintaxe of opening a file is different
unit AcadTest14;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ActiveX, ComObj, OleCtnrs;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
p1, p2 : OleVariant;
Acad, ActiveDoc, ViewPort : OleVariant;
begin
// create variant arrays to hold coordinates of the window
p1 := VarArrayCreate([0,2], VT_R8);
p2 := VarArrayCreate([0,2], VT_R8);
// assign values to array elements
p1[0] := 14330.0; p1[1] := 400.0; p1[2] := 0; //point (14330,400,0)
p2[0] := 26400.0; p2[1] := 8500.0; p2[2] := 0; //point (26400,8500,0)
Acad := CreateOleObject('AutoCad.Application.14');
if not varisempty(Acad) then
Acad.visible := visible;
// open drawing
ActiveDoc := Acad.ActiveDocument.Open('E:\Home\Planview.dwg');
//Activate viewport
ViewPort := ActiveDoc.ActiveViewPort;
// zoom appliciation
ViewPort.ZoomExtents;
ViewPort.ZoomWindow(VarArrayRef(p1),VarArrayRef(p2));
end;
end.
zhengji
2004-09-17
打赏
举报
回复
要不就是 AutoCAD 的 Application 里有炸图块的函数。呵呵,机器上没资料,帮不了你了。
另:AutoCAD 的帮助里有关于它所提供的 ActiveX 的说明,楼主可参考一下。
zhengji
2004-09-17
打赏
举报
回复
我记得又一个函数表示直接给AutoCAD 输入命令的,选中 Block 后,通过该函数让AutoCAD 执行一下 "_explode" 即可。
sunkevin
2004-09-17
打赏
举报
回复
没用过
delphi
在
autocad
二次开发例子(俄罗斯人写的)
delphi
在
autocad
二次开发例子(俄罗斯人写的),内置5个cad
操作
,画图等demo,写得相当好
AutoCad
自动化
操作
的
Delphi
类单元源码
我编写的
AutoCad
自动化
操作
的类,可以高效读取
AutoCad
数据。
AutoCad
GetPoint
利用vba 对
autocad
进行
操作
,可以通过此源码看到
delphi
对
autocad
的
操作
,以及
autocad
对VBA的支持. .dwg 文件没有上传,对要在
autocad
上进行简单开发,选择了vba模式的是一个参考. 这个是一个特定的对
autocad
模型进行点...
CAD
操作
ENTITIES) or (TABLES). <br>Also CAD Import VCL provides tool for Borland
Delphi
and Borland C++Builder developers allows to work with AutoDesk
AutoCAD
?DWG and DXF file formats, HPGL and HPGL2 ...
用
DELPHI
开发的结构力学平面设计系统源代码
使用
DELPHI
开发的一个结构力学平面设计系统...
操作
方式借鉴了
AUTOCAD
,其中包含了线段测量、图形数据统计测量、GDI绘画、矢量线段和图形的绘制。包含完整源代码和所使用的控件。这是一个初级版本,免费提供给大家学习。
Delphi
5,388
社区成员
262,730
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章