(defun flangeelevfillet ()
(command "_fillet"
"R"
"2"
(setq b1
(list a6
flgotppt
) ; end list
) ; end setq
(setq b2
(lista8
flgoltppt
) ; end list
) ; end setq
) ; end fillet
(command "_fillet"
"R"
"2"
(setq b3
(list
a7
flgobtpt
) ; end list
) ; end setq
(setq b4
(list
a9
flgolbtpt
) ; end list
) ; end setq
) ; end fillet
) ; end program
在圆角方面没有运气。。。当检查b1的值时,我得到:
Command: !b1
(<Entity name: 7e88fdf0> (331.409 328.982 0.0))
请注意,圆角命令在设置半径后退出,因此编写的命令不起作用。
这是错误的:
(command "_fillet""R""2"
(setq b1 (list a6 flgotppt))
(setq b2 (list a8 flgoltppt))
) ; end fillet
这是正确的:
(command "_.fillet""R""2"
"_.fillet" ; <---<<command must be stated again
(setq b1 (list a6 flgotppt))
(setq b2 (list a8 flgoltppt))
) ; end fillet 谢谢CAB,
只是出于兴趣,我有几个问题。。。。
1) (这似乎有点无知..但我对LISP不太熟悉)为什么在(defun c:XXX(“here”)后面的括号中列出变量。。。带“/”?
2) 为什么使用“vl cmdf”而不是“command”?
再次感谢你的帮助。 你是个天才。。。
Lisp程序就像一种享受!
谢谢你的帮助。 Is there any way to assign an variable to a fillet so that it may be rotated later?
I tried using the entlast function, but to no avail. This works for me.
(defun c:test (/ usrosm e1 e2 p1 rad) (setq rad 2.0) (setq usrosm (getvar "osmode")) (and (setq p1 (getpoint "\nPick a test point for fillet.")) (setq e1 (entmakex (list (cons 0 "LINE") (cons 8 "0") ; layer (cons 10 p1) ; start point (cons 11 (polar p1 pi 100)) ; end point ))) (setq e2 (entmakex (list (cons 0 "LINE") (cons 8 "0") ; layer (cons 10 p1) ; start point (cons 11 (polar p1 (* pi 1.5) 100)) ; end point ))) (setvar "osmode" 0) (setq usrrad (getvar "osmode")) (setvar "filletrad" rad) (vl-cmdf "_.fillet" (list e1 (polar p1 pi rad)) (list e2 (polar p1 (* pi 1.5) rad))) (setq rent1 (entlast)) ; this works (entdel rent1) ; remove the entity as a test ) (and usrrad (setvar "osmode" usrrad)) (and usrosm (setvar "osmode" usrosm)) (princ)) Thanks CAB,
Just out of interest, I have a few queries....
1) (this may seem a little ignorant.. but I'm new to LISP) Why do you list your variables in the brackets after the (defun c:XXX ("here")... with a " / " ?
2) Why do you use the "vl-cmdf" instead of "command"?
Thanks once again for your help. CAB you are a genius...
The LISP works like a treat!
Thanks for all your help.
页:
1
[2]