最初由 小狼 发布
[B]请问有那些Vlisp函数是与字典有关的,我想求字典下扩展记录,并显示字典以及扩展记录的名称和属性。
一定要Vlisp的C++和VBA我不会用,最好能帮我写段原码,急需。
谢谢 [/B]
小狼!!嘿嘿....!!!

- [FONT=courier new]
- (defun c:asdk_lisp_create ();(/ xrec xname dict dname)
- ; create the Xrecord entity's data list
- (setq xrec '((0 . "XRECORD")(100 . "AcDbXrecord")
- (1 . "www")
- (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))
- ; Within the named object dictionary, attempt to get the
- ; entity name of the dictionary associated with the key
- ; "ASDK_DICT". If it doesn't exist, create it.
- (setq dname (cdr (assoc -1 (dictsearch (namedobjdict) "ASDK_DICT"))))
- (if (not dname) (progn
- (setq dict '((0 . "DICTIONARY")(100 . "AcDbDictionary")))
- (setq dname (entmakex dict))
- (dictadd (namedobjdict) "ASDK_DICT" dname))
- )
- ; add the new Xrecord entity to the named object dictionary
- (dictadd dname "XRECLISP" xname)
- (princ)
- )
- (defun c:asdk_lisp_listxrec ();(/ xlist dname)
- ; find the dictionary associated with the key "ASDK_DICT"
- (setq dname (cdr (assoc -1 (dictsearch (namedobjdict) "ASDK_DICT"))))
-
- ; find the Xrecord in the ASDK_DICT dictionary
- (setq xlist (dictsearch dname "XRECLISP"))
- ; print out the Xrecord's data list
- (princ xlist)
- (princ)
- )
- [/FONT]
|