本帖最后由 carrot1983 于 2015-10-8 09:02 编辑
真正用到文字上时,还是发现有问题,
原因出在文字镜像后会自转,自己调整。
如果用mirrtext 设成1,就可以。
但是,实际应用中,不需要 (setvar "MIRRTEXT" 1)
"MIRRTEXT" 为1时, 镜像后的文字的
"反向" 特性是"是"
重新上传一下附件,把实际应用的问题显现出来,集思广义。
- (defun C:TT2 ()
- (princ "\n选择测试镜像的文字")
- (setvar "MIRRTEXT" 0)
- (if (setq SS (ssget))
- (progn
- (initget 1)
- (setq PT1 (getpoint "\n指定镜像第一点: "))
- (initget 1)
- (setq PT2 (getpoint PT1 "\n指定第二点: "))
- (setq E (entlast))
- (command "._MIRROR" SS "" "NON" PT1 "NON" PT2 "N")
- (while (/= (getvar "CMDACTIVE") 0) (command ""))
- (while (setq E (entnext E))
- ;;(setq E (car (entsel)))
- (setq ELIST (entget E)
- V0 (cdr (assoc 0 ELIST))
- V50 (cdr (assoc 50 ELIST))
- V1 (cdr (assoc 1 ELIST))
- )
- (if (and (= V0 "TEXT")
- (wcmatch V1 "*-*-*,G*-*,VT*-*")
- )
- (progn
- (setq ANG (+ V50 (* 0.5 pi))) ;_文字的垂直角度
- (setq ANG (read (angtos ANG 0 6)))
- (if (not (or (equal ANG 180.0 1e-6)
- (< 0 ANG 180.0)
- )
- )
- (vla-put-color (vlax-ename->vla-object E) 1)
- )
- )
- )
- )
- )
- )
- (princ)
- )
- (defun C:TT3 ()
- (princ "\n选择测试镜像的文字")
- (setvar "MIRRTEXT" 1)
- (if (setq SS (ssget))
- (progn
- (initget 1)
- (setq PT1 (getpoint "\n指定镜像第一点: "))
- (initget 1)
- (setq PT2 (getpoint PT1 "\n指定第二点: "))
- (setq E (entlast))
- (command "._MIRROR" SS "" "NON" PT1 "NON" PT2 "N")
- (while (/= (getvar "CMDACTIVE") 0) (command ""))
- (while (setq E (entnext E))
- ;;(setq E (car (entsel)))
- (setq ELIST (entget E)
- V0 (cdr (assoc 0 ELIST))
- V50 (cdr (assoc 50 ELIST))
- V1 (cdr (assoc 1 ELIST))
- )
- (if (and (= V0 "TEXT")
- (wcmatch V1 "*-*-*,G*-*,VT*-*")
- )
- (progn
- (setq ANG (+ V50 (* 0.5 pi))) ;_文字的垂直角度
- (setq ANG (read (angtos ANG 0 6)))
- (if (not (or (equal ANG 180.0 1e-6)
- (< 0 ANG 180.0)
- )
- )
- (vla-put-color (vlax-ename->vla-object E) 1)
- )
- )
- )
- )
- )
- )
- (princ)
- )
|