一个简单修改程序
- (defun c:tt (/ e obj name data dicts xd)
- (if (and (setq e (car (entsel "\nSelect Object: ")))
- (setq obj (vlax-ename->vla-object e))
- (= (vla-get-hasExtensionDictionary obj) :vlax-true)
- (setq Name (getstring "\nXrecord Name: "))
- (setq data (getstring "\nXrecord Data<String>: "))
- )
- (progn
- (setq dicts (vla-GetExtensionDictionary obj))
- (vlax-for dict dicts
- (if (and (= (vla-get-objectname dict) "AcDbXrecord")
- (= (strcase (vla-get-name dict)) (strcase name))
- )
- (progn
- (vla-getxrecorddata dict 'xt 'xd)
- (setq xd (safearray-value xd))
- (vla-setxrecorddata
- dict
- xt
- (vlax-safearray-fill
- (vlax-make-safearray
- vlax-vbvariant
- '(0 . 1)
- )
- (list (car xd) (vlax-make-variant data vlax-vbstring))
- )
- )
- )
- )
- )
- )
- )
- (princ)
- )
命令: TT
Select Object:
Xrecord Name: QLR_TDZH
Xrecord Data<String>: Myname
命令:
命令: LISTXRC
Select Object:
(QLR_BSM (1001 . QLR_BSM) (1071 . 0))
(QLR_DJH (1001 . QLR_DJH) (1000 . 121100GCAA002))
(QLR_DLRDHHM (1001 . QLR_DLRDHHM) (1000 . ))
(QLR_DLRSFZMS (1001 . QLR_DLRSFZMS) (1000 . ))
(QLR_DLRXM (1001 . QLR_DLRXM) (1000 . 代理人))
(QLR_DLRZJH (1001 . QLR_DLRZJH) (1000 . 22222222222222222222222222222222222222))
(QLR_DLRZJLX (1001 . QLR_DLRZJLX) (1000 . 3 护照))
(QLR_FRDBDHHM (1001 . QLR_FRDBDHHM) (1000 . ))
(QLR_FRDBSFZMS (1001 . QLR_FRDBSFZMS) (1000 . ))
(QLR_FRDBXM (1001 . QLR_FRDBXM) (1000 . 法人代表))
(QLR_FRDBZJH (1001 . QLR_FRDBZJH) (1000 . 33333333333333333333333333333333333333))
(QLR_FRDBZJLX (1001 . QLR_FRDBZJLX) (1000 . 2 军官证))
(QLR_QLRMC (1001 . QLR_QLRMC) (1000 . 罗桑))
(QLR_QLRZJH (1001 . QLR_QLRZJH) (1000 . 1111111111111111111111111111))
(QLR_QLRZJLX (1001 . QLR_QLRZJLX) (1000 . 1 居民身份证))
(QLR_TDZH (1001 . QLR_TDZH) (1000 . Myname))
(SOUTH (1001 . SOUTH) (1000 . 罗桑))
|