CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

相关分类

筛选扩展数据

2023-1-1 02:33| 发布者: admin| 查看: 293| 评论: 0|来自: AutoCAD

扩展数据 (xdata) 是文本字符串、数值、3D 点、距离、图层名称或附加到对象的其他数据,通常由外部应用程序提供。

扩展数据的大小为 16K 字节。

通过使用 -3 组代码在筛选器列表中指定特定应用程序的名称,可以检索特定应用程序的扩展数据。该函数返回具有注册到指定名称的扩展数据的实体;不检索单个扩展数据项(组码在 1000–2000 范围内)。acedSSGet()acedSSGet()

以下示例代码片段选择已向 ID 为 “” 的应用程序注册扩展数据的所有圆圈。APPNAME

eb1.restype = 0; // Entity type
strcpy(sbuf1, "CIRCLE"); 
eb1.resval.rstring = sbuf1; // Circle
eb1.rbnext = &eb2; 
eb2.restype = -3; // Extended data
eb2.rbnext = &eb3; 
eb3.restype = 1001; 
strcpy(sbuf2, "APPNAME"); 
eb3.resval.rstring = sbuf2; // APPNAME application
eb3.rbnext = NULL; 
// Select circles with XDATA registered to APPNAME.
acedSSGet("X", NULL, NULL, &eb1, ssname1); 

如果列表中包含多个应用程序名称,则仅当某个实体具有所有指定应用程序的扩展数据时,才在选择集中包括该实体。例如,以下代码选择具有注册到 “” 和 “” 的扩展数据的圆圈。acedSSGet()APP1APP2

eb1.restype = 0; // Entity type
strcpy(sbuf1, "CIRCLE"); 
eb1.resval.rstring = sbuf1; // Circle
eb1.rbnext = &eb2; 
eb2.restype = -3; // Extended data
eb2.rbnext = &eb3; 
eb3.restype = 1001; 
strcpy(sbuf2, "APP1"); 
eb2.resval.rstring = sbuf2; // APP1 application
eb2.rbnext = &eb4; 
eb4.restype = 1001; // Extended data
strcpy(sbuf3, "APP2"); 
eb4.resval.rstring = sbuf3; // APP2 application
eb4.rbnext = NULL; 
// Select circles with XDATA registered to APP1 & APP2.
acedSSGet("X", NULL, NULL, &eb1, ssname1); 

您可以使用通配符字符串指定应用程序名称,以便一次搜索多个应用程序的数据。例如,以下代码选择扩展数据注册到 “” 和/或 “” 的所有圆圈。APP1APP2

eb1.restype = 0; // Entity type
strcpy(sbuf1, "CIRCLE"); 
eb1.resval.rstring = sbuf1; // Circle
eb1.rbnext = &eb2; 
eb2.restype = -3; // Extended data
eb2.rbnext = &eb3; 
eb3.restype = 1001; // Extended data
strcpy(sbuf2, "APP1,APP2"); 
eb3.resval.rstring = sbuf2; // Application names
eb3.rbnext = NULL; 
// Select circles with XDATA registered to APP1 or APP2.
acedSSGet("X", NULL, NULL, &eb1, ssname1); 

以下字符串查找同一应用程序的扩展数据。

strcpy(sbuf2, "APP[12]"); 

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 14:27

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部