找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1039|回复: 2

[文章]:用entmake生成R13以后实体的方法

[复制链接]

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-1-30 00:43:22 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
There are differences in making an entity using "entmake." For the entity types
that are introduced in AutoCAD Release 13 and later, you must specify subclass
markers (DXF group code 100) when creating the entity; while the entity types
that exist from earlier releases do not require them. Therefore this has resulted
in some confusion. Those newer entity types include ELLIPSE, LEADER, SPLINE,
XLINE, TOLERANCE, MLINE and MTEXT. Since these entities fall into a more tightly
managed entity hierarchy, they require more information to define them when
using the entmake facility via AutoLISP or ObjectARX.

The following list identifies the entities that do not require subentity marker
entries in the list passed to entmake:

3DFACE, ARC,
ATTDEF, ATTRIB,
CIRCLE, DIMENSION,
INSERT, LINE,
POINT, POLYLINE (old-style),
SEQEND, SHAPE,
SOLID, TEXT,
TRACE, VERTEX,
VIEWPORT

The new information required is referred to as the subentity markers for the
entities. All entities have the AcDbEntity subclass marker; this must be explicitly
included in the entmake list for newer entity types. The additional subentity
marker, also required, refers directly to the entity type that it belongs to.

The conditions necessary to entmake a newer entity are as follows:

1. You must explicitly include group code 100 dictionary entries for the AcDbEntity
and AcDb<specific subentity class marker> in the entmake list.

2. In the entmake list these two entries must follow group code 0 and must precede
group codes that are specifically used to define the entity in the entmake list.

下面是用AUTOLISP entmake一个MTEXT实体的最短代码...


  1. (entmake '(
  2.     (0 . "MTEXT")
  3.     (100 . "AcDbEntity")
  4.     (8 . "ALAYER")
  5.     (100 . "AcDbMText")
  6.     (10 4.0 4.0 0.0)
  7.     (1 . "Some\\Ptext")))


  8. 下面是用ARX的acdbEntMake 生成一个MTEXT的最短代码

  9. int makeMtext(void)
  10. {
  11.     ads_point pt = {4.0,4.0,0.0};  // MTEXT insertion point.


  12.     //  Build a list to define a MTEXT.
  13.     //  Since MTEXT is an entity that is introduced in AutoCAD Release 13 and later,
  14.     //  the subclass markers, AcDbEntity and AcDbMText, must be present.
  15.     struct resbuf *elist = acutBuildList(
  16.         RTDXF0, "MTEXT",
  17.         100, "AcDbEntity",
  18.         8, "ALAYER",
  19.         100, "AcDbMText",
  20.         10, pt,
  21.         1, "Some\\Ptext",
  22.         RTNONE);


  23.     if (elist == NULL) {
  24.         acutPrintf("\nMtext creation failed <buildlist failed>....");
  25.         return RTERROR;
  26.     }  

  27.     int status = acdbEntMake(elist);
  28.     acutRelRb(elist);


  29.     if (status != RTNORM) {
  30.         acutPrintf("\nMtext creation failed <entmake failed>....");
  31.         return RTERROR;
  32.     }
  33.     acedRetVoid();
  34.     return RTNORM;
  35. }

复制代码
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2002-1-30 01:28:35 | 显示全部楼层
实例?:)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 145个

财富等级: 日进斗金

 楼主| 发表于 2002-1-30 01:37:00 | 显示全部楼层
最初由 cy956 发布
[B]实例?:) [/B]


老菜研究ENTMAKE有心得,这个还是交给你来吧:)

:c :c :c
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-12-5 03:21 , Processed in 0.449036 second(s), 33 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表