明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 824|回复: 3

[求助]帮忙看看这个是什么毛病!!

[复制链接]
发表于 2008-9-6 15:48:00 | 显示全部楼层 |阅读模式

  (defun c:yy()
  (setvar "cmdecho" 0)
  (princ "请选择需要打散的文字:")
  (setq text (car(entsel)))
  (setq te (entget text))
  (setq text1 (cdr (assoc 1 te)))
  (setq high  (cdr (assoc 40 te)))
  (setq lyr   (cdr (assoc 8 te)))
  (setq zx   (cdr (assoc 7 te)))
  (command "-layer" "s" lyr "")
  (command "-color" "bylayer")
  (if (/= "" (cdr(assoc 4  (tblsearch "style" zx ))))                                           
  (setq zt (strcat (cdr(assoc 3  (tblsearch "style" zx ))) "," (cdr(assoc 4  (tblsearch "style" zx )))))
  (setq zt (cdr(assoc 3 (tblsearch "style" zx ))))
  );end if
  (command "-style" zx zt "0" "1" "" "" "" "")
  (setq len (strlen text1))            
  (setq n 1)
  (setq j 1)       
      (while(<= n len)
      (if(> (ascii(substr text1 n 1)) 127)(progn
           (setq stm (substr text1 n 2))
           (princ "\n请指定第") (princ j) (princ "个点的位置:")
           (setq xy (getpoint))
           (command "text" "j" "ml" (list (- (car xy) (/ high 2))  (cadr xy)  ) high "0" stm)
           (setq j (+ j 1))
           (setq n (+ n 2)))(progn
           (setq stm (substr text1 n 1))
           (princ "\n请指定第") (princ j) (princ "个点的位置:")
           (setq xy (getpoint))
           (command "text" "j" "ml" (list (- (car xy) (/ high 2))  (cadr xy)  ) high "0" stm)
           (setq j (+ j 1))
           (setq n (+ n 1)))  
      );end if
      );end while     
  (setvar "cmdecho" 1)
  (princ)
);end defun

请选择需要打散的文字:
选择对象: 未知命令“YY”。按 F1 查看帮助。
请指定第1个点的位置:
请指定第2个点的位置:
请指定第3个点的位置:

能顺利执行,选择对象之后会出现错误“未知命令“YY”。按 F1 查看帮助”

发表于 2008-9-6 16:00:00 | 显示全部楼层

(command "-style" zx zt "0" "1" "" "" "" "")

删除最后一个回车

 楼主| 发表于 2008-9-6 16:19:00 | 显示全部楼层
也不行,shx文件和TTF文件情况不一样!!SHX文件有个是否垂直!!
发表于 2008-9-6 16:50:00 | 显示全部楼层

(command "-style" zx zt "0" "1" "" "" "" "")

改成

(command "-style" zx zt "0" "1")

(while (/= 0 (getvar "cmdactive")) (command ""))

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-9-21 09:08 , Processed in 0.166927 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表