Xrecord 对象用于存储和管理任意数据。 它们由 DXF 组代码和普通对象组代码(即非 xdata 组代码)组成,支持的范围范围为 1 到 369。这些对象在概念上与 xdata 类似,但不受大小或顺序的限制。 下面的代码示例在名为 XRECLIST 的自定义字典中创建并列出 xrecord 数据。 (defun C:MAKEXRECORD( / xrec xname ) ; create the xrecord's data list. (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)) ) ; use entmakex to create the xrecord with no owner. (setq xname (entmakex xrec)) ; add the new xrecord to the named object dictionary. (dictadd (namedobjdict) "XRECLIST" xname) (princ) ) (defun C:LISTXRECORD ( / xlist ) ; find the xrecord in the named object dictionary. (setq xlist (dictsearch (namedobjdict) "XRECLIST")) ; print out the xrecord's data list. (princ xlist) (princ) ) LISTXRECORD 命令的结果将类似于以下内容: ((-1 . <Entity name: 7ffffb05ee0>) (0 . XRECORD) (5 . 1E6) (102 . {ACAD_REACTORS) (330 . <Entity name: 7ffffb038c0>) (102 . }) (330 . <Entity name: 7ffffb038c0>) (100 . AcDbXrecord) (280 . 1) (1 . This is a test xrecord list) (10 1.0 2.0 0.0) (40 . 3.14159) (50 . 3.14159) (62 . 1) (70 . 180)) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 14:54
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.