从网上找的,提供给大家 - (defun XD-M()
- (while (not(setq en (entsel "选择一个实体:")))
- (alert "没选中任何实体...")
- )
- (princ "\n(现有")(princ(XDRoom(car en)))
- (princ "\n字节的扩展实体数据空间.)\n")
- (setq en (car en)
- un (getstring "\n应用名:")
- )
- (if (XD-C en un)
- (progn (textscr)
- (princ "\n这个应用名已经存在了,要覆盖它吗?")
- (initget 7 "Yes No")
- (if (= "Yes" (getkword "Yes/<No>:"))
- ()
- (abcdefg)
- )
- )
- )
- (setq ll (list (cons 1002 "}")))
- (initget 7 "Real Integer String")
- (setq tp (getkword "Real(实数)/Integer(整数)/String(字串):"))
- (while (not(or (= tp "End")(= tp "")))
- (cond ((= tp "Real")
- (setq v (getreal "\n实型数:") l (cons 1040 v))
- )
- ((= tp "String")
- (setq v (getstring "\n字符串:") l (cons 1000 v))
- )
- ((= tp "Integer")
- (setq v (getint "\n整型数:") l (cons 1071 v))
- )
- )
- (setq ll (cons l ll))
- (initget 7 "Real Integer String End")
- (setq tp (getkword "Real(实数)/Integer(整数)/String(字串)/<End>:"))
- )
- (setq ll (cons (cons 1002 "{") ll)
- ll (list -3 (cons un ll))
- el (entget en)
- nel (cons ll el)
- )
- (regapp un)(entmod nel)
- )
|