马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- [FONT=courier new]
- ;;;--------------------------------------
- ;;; 变块中实体 ;;;;;;;;;;;;; lxx v1.02
- ;;;--------------------------------------
- (princ "\n变块中实体v1.02---------lxx.2001.6")
- (defun cbe (cod key / nl)
- (while (not(progn (setq en (nentsel)
- ent (car en)
- entl (entget ent '("*"))
- )
- ) )
- )
- (if (setq eb (last (nth 3 en)))
- (setq ebl (entget eb)))
- (redraw ent 3)
- (if (= cod "x")
- (progn
- (textscr)
- (mapcar 'print entl)(princ)
- (setq cod (getint "\n组码:"))
- )
- )
- (setq ec (cdr (assoc cod entl)))
- (princ "\n原值:")(princ (assoc cod entl))
- (if (= 1 key)
- (if (not (setq nv (cdr (assoc cod (setq ent2 (entget (car(nentsel "\n选择参照实体:"))))))))
- (if (= cod 62)(setq nv (cdr (assoc cod (tblsearch "LAYER" (cdr (assoc 8 ent2)) ) ))));;有待完善
- )
- (cond ;;;;;;else
- ((= 'STR (type ec))(setq nv (getstring t "\n字串替换为:")))
- ((= 'INT (type ec))(setq nv (getint "\nINT值替换为:")))
- ((= 'REAL (type ec))(setq nv (getreal "\n\nREAL值替换为:")))
- ((= 'LIST (type ec))
- (setq nv (read (strcat "(" (getstring t "\nLIST替换为(点表-->回车取参照点):") ")")));;如 "1.0 3.3 0.0"
- (graphscr)
- (if (not nv)(setq nv (setq cpt (getpoint "\n点取参照点:"))))
- (if eb (setq nv (trans cpt 1 ent)))
- )
- ((not ec) (setq nl (read (getstring t "\n加入新表元(...):"))))
- )
- )
- (if (not nl) (setq nl (cons cod nv)))
- (princ "\n新值:")(princ nl)
- (graphscr)
- (redraw ent 4)
- (if ec
- (setq entl (subst nl (assoc cod entl) entl))
- (setq entl (append entl (list nl)))
- )
- (entmod entl)(entupd ent)(if eb (entupd eb))
- ;(setq cod nil key nil)
- )
- ;;;;;;;;;;;;;;;;;;
- (defun c:xla (/ cod key) (princ "\n改层")(cbe 8 0)(princ))
- (defun c:xla2 (/ cod key) (princ "\n改层k")(cbe 8 1)(princ))
- (defun c:xc (/ cod key) (princ "\n改色")(cbe 62 0)(princ))
- (defun c:xc2 (/ cod key) (princ "\n改色k")(cbe 62 1)(princ))
- (defun c:xlt (/ cod key) (princ "\n改线形")(cbe 6 0)(princ))
- (defun c:xlt2 (/ cod key) (princ "\n改线形k")(cbe 6 1)(princ))
- (defun c:xt (/ cod key) (princ "\n改字串")(cbe 1 0)(princ))
- (defun c:xt2 (/ cod key) (princ "\n改字串")(cbe 1 1)(princ))
- (defun c:xx1 (/ cod key)(princ "\n改实体数据库 :")(cbe "x" 0)(princ))
- (defun c:xx2 (/ cod key)(princ "\n改实体数据库 :")(cbe "x" 1)(princ))
- ;;;;;;;;请自行扩展
- [/FONT]
|