Xrecord 对象可用于存储和管理任意数据
Xrecord 对象可以增加到词典中
词典是随图档一起保存的。
下例中提供了创建和列举 xrecord 数据的方法。
(defun C:MAKEXRECORD( / xrec xname ) ; 创建 xrecord 的数据表 (setq xrec '((0 . "XRECORD")(100 . "AcDbXrecord") (1 . "This is a test xrecord list") (10 1.0 2.0 0.0) (40 . 3.14159) (50 . 3.14159) (62 . 1) (70 . 180)) )
; 调用 entmakex 来创建一个无所有者的 xrecord (setq xname (entmakex xrec))
; 向命名对象词典中增加新 xrecord (dictadd (namedobjdict) "XRECLIST" xname)
(princ) )
(defun C ISTXRECORD ( / xlist ) ; 在命名对象词典中查找 xrecord (setq xlist (dictsearch (namedobjdict) "XRECLIST"))
; 打印输出 xrecord 的数据表 (princ xlist)
(princ)
) |