nithink55 发表于 2022-7-5 23:53:40

autolisp程序ucs


(defun c:ucsmen()
(setq pt1 (getpoint "\npick new orgin"))
(setq Pt2 (getpoint "second point") )
(setq Pt3 (getpoint "third point" ) )
(command "_ucs""3"Pt1 Pt2 Pt3 )
)
 
 
我是autolisp新手。。加载后出现的错误是“UCSIENS未知命令”UCSIENS。按F1键可获取帮助
 
此lisp通过单击屏幕来设置ucs
请帮忙。
 
提前感谢

MSasu 发表于 2022-7-6 00:13:20

虽然您的代码中存在一些问题,但上述错误似乎表明您的代码没有正确加载。
我做了一些修改并发表了评论:
(defun c:ucsmen( / pt1 pt2 pt3 )                           ;localize the variables - no conflict with other functions
(if (and (setq pt1 (getpoint "\npick new orgin"))         ;ensure right input
         (setq Pt2 (getpoint "\nsecond point"))         ;print each prompt on its own line (clearer)
         (setq Pt3 (getpoint "\nthird point" )))
(command "_ucs" "3" "_non" Pt1 "_non" Pt2 "_non" Pt3 )   ;ensure no conflict with active OSNAP
)

(princ)                                                 ;exit silent
)
 
此外,请编辑您的帖子并添加所需的代码标签。个人观点,但这篇文章更适合在AutoLISP子论坛。

dbroada 发表于 2022-7-6 00:26:27

我认为这也被张贴在LISP论坛上。 
nithink55,请不要重复帖子-这只会让大家困惑。

MSasu 发表于 2022-7-6 00:52:52

没错,Dbroada,我没有注意到这是一个双重职位。

BIGAL 发表于 2022-7-6 01:00:53

为什么不简单一点呢
 
 

(defun c:ucs3 ()
(command "UCS" 3)
)
页: [1]
查看完整版本: autolisp程序ucs