求lsp程序,在“tmp123”图层画矩形的同时,以矩形的对角点连线画上交叉线。
求lsp程序,在“tmp123”图层画矩形的同时,以矩形的对角点连线画上交叉线。 (defun c:recx ()(setq clayer (getvar "clayer"))
(command "layer" "m" "tmp123""c" 7 "" "")
(setq pt3 (getcorner (setq pt1 (getpoint)) "选择另一点"))
(setq pt2 (list (car pt3) (car (cdr pt1))))
(setq pt4 (list (car pt1) (car (cdr pt3))))
(command "PLINE" pt1 pt2 pt3 pt4 "c" "")
(command "line" pt1 pt3 "")
(command "line" Pt2 pt4 "")
(setvar "clayer" clayer)
(princ)
)
(defun c:tt(/ p1 p2)
(setvar 'cmdecho 0)
(setvar 'clayer "tmp123")
(vl-cmdf "rectang" (setq p1(getpoint"\n第一点"))(setq p2(getcorner p1"\n第二点")))
(vl-cmdf "line" p1 p2)
(princ)
) 感谢哥几个,帮了大忙了。 感谢哥几个,帮了大忙了。 yjr111 发表于 2013-2-1 18:39
(defun c:tt(/ p1 p2)
(setvar 'cmdecho 0)
(setvar 'clayer "tmp123")
你代码错的 kwok 发表于 2013-2-1 18:36
(defun c:recx ()
(setq clayer (getvar "clayer"))
(command "layer" "m" "tmp123""c" 7 "" "") ...
请问为何报错无线型c?之前都是这么建层没报错?:lol
(defun c:recx ()
(setq clayer (getvar "clayer"))
(command "layer" "m" "1CL14-DK-SETBLOCK" "c" "9" "" "l" "c" "" "");;;1材料垫块114
(setq pt3 (getcorner (setq pt1 (getpoint)) "选择另一点"))
(setq pt2 (list (car pt3) (car (cdr pt1))))
(setq pt4 (list (car pt1) (car (cdr pt3))))
(command "PLINE" pt1 pt2 pt3 pt4 "c" "")
(command "line" pt1 pt3 "")
(command "line" Pt2 pt4 "")
(setvar "clayer" clayer)
(princ)
)
页:
[1]