Autolisp 程序 参数类型错误 5
错误:参数类型错误:二维/三维点:10程序:(defunc:lsp_25()(setvar"cmdecho"0)(setqos(getvar"osmode"))(setv...
错误: 参数类型错误: 二维/三维点: 10
程序:
(defun c:lsp_25()
(setvar "cmdecho" 0)
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(setq en (car (entsel "\n选取线:")))
(setq pt10 (car (assoc 10 (entget en))))
(setq pt11 (cdr (assoc 11 (entget en))))
(setq dd (distance pt10 pt11))
(setq shh (getvar "textsize"))
(princ "\n线段长度=")
(princ dd)
(setq str_hh (strcat "\n文字高度<" (rtos shh 2) ">:"))
(setq hh (getdist pt10 str_hh))
(if (null hh) (setq hh shh))
(setq txt (getstring "\n文字内容:"))
(setq ang (angle pt10 pt11))
(setq i 1 txtpt pt10)
(setq nn (1- (strlen txt)))
(repeat (1+ nn)
(setq stxt (substr txt i 1))
(command "text" "c" txtpt hh (* (/ ang pi) 180) stxt)
(setq txtpt (polar txtpt ang (/ dd nn)))
(setq i (1+ i))
)
(setvar "osmode" os)
(prin1)
)
程序无法正常运行 请高手帮忙看下 问题出在哪里。
这程序是在一条线上写上文字。 展开
程序:
(defun c:lsp_25()
(setvar "cmdecho" 0)
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(setq en (car (entsel "\n选取线:")))
(setq pt10 (car (assoc 10 (entget en))))
(setq pt11 (cdr (assoc 11 (entget en))))
(setq dd (distance pt10 pt11))
(setq shh (getvar "textsize"))
(princ "\n线段长度=")
(princ dd)
(setq str_hh (strcat "\n文字高度<" (rtos shh 2) ">:"))
(setq hh (getdist pt10 str_hh))
(if (null hh) (setq hh shh))
(setq txt (getstring "\n文字内容:"))
(setq ang (angle pt10 pt11))
(setq i 1 txtpt pt10)
(setq nn (1- (strlen txt)))
(repeat (1+ nn)
(setq stxt (substr txt i 1))
(command "text" "c" txtpt hh (* (/ ang pi) 180) stxt)
(setq txtpt (polar txtpt ang (/ dd nn)))
(setq i (1+ i))
)
(setvar "osmode" os)
(prin1)
)
程序无法正常运行 请高手帮忙看下 问题出在哪里。
这程序是在一条线上写上文字。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询