筛选扩展数据
扩展数据 (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]"); 父主题: |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-3-14 05:59
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.