- UID
- 1
- 积分
- 15892
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
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实体的最短代码...
- (entmake '(
- (0 . "MTEXT")
- (100 . "AcDbEntity")
- (8 . "ALAYER")
- (100 . "AcDbMText")
- (10 4.0 4.0 0.0)
- (1 . "Some\\Ptext")))
- 下面是用ARX的acdbEntMake 生成一个MTEXT的最短代码
- int makeMtext(void)
- {
- ads_point pt = {4.0,4.0,0.0}; // MTEXT insertion point.
- // Build a list to define a MTEXT.
- // Since MTEXT is an entity that is introduced in AutoCAD Release 13 and later,
- // the subclass markers, AcDbEntity and AcDbMText, must be present.
- struct resbuf *elist = acutBuildList(
- RTDXF0, "MTEXT",
- 100, "AcDbEntity",
- 8, "ALAYER",
- 100, "AcDbMText",
- 10, pt,
- 1, "Some\\Ptext",
- RTNONE);
- if (elist == NULL) {
- acutPrintf("\nMtext creation failed <buildlist failed>....");
- return RTERROR;
- }
-
- int status = acdbEntMake(elist);
- acutRelRb(elist);
- if (status != RTNORM) {
- acutPrintf("\nMtext creation failed <entmake failed>....");
- return RTERROR;
- }
- acedRetVoid();
- return RTNORM;
- }
复制代码 |
|