明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1596|回复: 4

[求助]请问能不能将字符串信息附加在多段线或线段中

[复制链接]
发表于 2004-11-4 15:58:00 | 显示全部楼层 |阅读模式
我想把线槽的大小,如:CT50X50,记录在线段或多段线中,方便以后查看,而不必显示出来.请问能不能实现?
发表于 2004-11-4 16:18:00 | 显示全部楼层
可以使用扩展数据更新入对象里去
发表于 2004-11-4 16:21:00 | 显示全部楼层
  1. (defun C:Test (/ sel en)
  2.    (if (setq sel (entsel "\n选择线段或多段线:"))
  3.        (if (wcmatch (cdr (assoc 0 (entget (setq en (car sel))))) "*LINE")
  4.            (progn
  5.   (X_DATA_ADD en "SIZE" '((1000 . "CT50X50")))
  6.   (princ "\n数据"CT50X50"已附加在该图元上。")
  7.            )
  8.            (princ "\n无效图元。")
  9.        )
  10.        (princ "\n没有选中图元。")
  11.    )
  12.    (princ)
  13. )
  14.            
  15. ;----------------------------------------------------------
  16. ;   Extended data Utilities and Example of use
  17. ;   From 1999 Autodesk University course PR31
  18. ;   taught by Bill Kramer
  19. ;;---------------------------------------------------------
  20. ;; X_DATA_ADD   add extended data list DLST with
  21. ;;                         application name APID to the entity list
  22. ;;                         of entity name EN.
  23. ;;                         Overwrites existing.
  24. ;;
  25.   (defun X_DATA_ADD (EN APID DLST / EL TMP1)
  26.      (if (null (tblsearch "APPID" APID)) ;;registered?
  27.            (regapp APID)) ;;register it
  28.      (setq EL (entget EN) ;;get Entity list
  29.                  TMP1 (list -3 (cons APID DLST))
  30.      )
  31.      (if (< (xdsize TMP1) (xdroom EN)) ;;got enough room?
  32.            (entmod (append EL (list TMP1)))) ;;modify database
  33. )
 楼主| 发表于 2004-11-4 16:51:00 | 显示全部楼层
加了以后怎样查看啊?


我用list也看不到.
发表于 2004-11-4 17:31:00 | 显示全部楼层
(entget (car (entsel)) '("SIZE"))
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-30 08:33 , Processed in 0.177676 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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