明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 792|回复: 2

[【VScode】] 【视频】动态DCL 之扩展数据查看,新增过滤器设置

[复制链接]
发表于 2023-1-10 15:24 | 显示全部楼层 |阅读模式
本帖最后由 vitalgg 于 2023-1-11 09:03 编辑

动态DCL 之扩展数据查看. 小试 vscode 写 lisp.

新增过滤器设置,可以先设置过滤器,选择自己需要的扩展数据。

源码已更新,见下面的网址
源码: https://gitee.com/atlisp/packages/tree/main/at-xdata

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;; 这是使用开发工具 dev-tools 自动创建的程序源文件
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4. ;; 定义配置项 'at-xdata:first 用于 应用包 at-xdata 的 第一个配置项 first
  5. ;; (@:get-config 'at-xdata:first) ;; 获取配置顶的值
  6. ;; (@:set-config 'at-xdata:first  "新设的值") ;; 设置配置顶的值
  7. ;; 向系统中添加菜单
  8. (@:add-menu "扩展数据管理" "查询扩展数据" '(at-xdata:browser))
  9. (defun at-xdata:browser ()
  10.   (setq ss-x (ssget "x" '((-3 ("*")))))
  11.   (@:log "INFO" (strcat "发现了" (itoa (sslength ss-x)) "个有扩展数据的图元"))
  12.   (setq order-ent 0)
  13.   (if (setq current (ssname ss-x order-ent))
  14.     (progn
  15.       (pickset:zoom current)
  16.       (sssetfirst nil (ssadd current))))
  17.   (dcl:dialog "xdata")
  18.   (dcl:mtext "xdata" 8 50)
  19.   (dcl:button "next" "Next" "")
  20.   (dcl:dialog-end-ok-cancel)
  21.   (defun gen-mtext ()
  22.     (strcat "第 "(itoa (1+ order-ent))" 个,共 "(itoa (sslength ss-x))" 个\n"
  23.       "图元类型:"(entity:getdxf current 0) "\n"
  24.       (if (wcmatch (entity:getdxf current 0) "INSERT")
  25.         (strcat "名称:" (block:get-effectivename current) "\n")
  26.         "")
  27.       "扩展数据\n"
  28.       (string:from-list
  29.         (mapcar
  30.           '(lambda (x)
  31.              (strcat "APPID:" (car x)"\n"
  32.                (vl-prin1-to-string (cdr x))))
  33.           (cdr (assoc -3 (entget current '("*")))))"\n")))
  34.   (defun cb-next (/ current)
  35.     (setq order-ent (1+ order-ent))
  36.     (if (>= order-ent (sslength ss-x))
  37.       (setq order-ent 0))
  38.     (if (setq current (ssname ss-x order-ent))
  39.       (progn
  40.         (pickset:zoom current)
  41.         (dcl:set-mtext "xdata" (gen-mtext))
  42.         (sssetfirst nil (ssadd current)))
  43.       (setq order 0)))
  44.   (dcl:new "xdata")
  45.   (dcl:set-mtext "xdata" (gen-mtext))
  46.   (set_tile "title" "扩展数据查看")
  47.   (dcl:show)
  48.   (princ))



新增过滤器设置:




代码截图:


效果图:



视频:








本帖子中包含更多资源

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

x
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2023-8-3 17:00 | 显示全部楼层
怎么加载啊
 楼主| 发表于 2023-8-3 18:10 | 显示全部楼层

签名里的网址

https://atlisp.cn
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-3 15:30 , Processed in 0.706847 second(s), 30 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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