在平时画图中,用LINE 命令时 指定第一点,然后输入如: <45,第二点就可以按我们需要的角度画出。 现在我想过某直线上一点画与该线垂直的直线,但程序在 (command "line".......那里出错,前辈帮我看一下, (defun c:ll() (setq endata (entget (car(entsel)))) (setq en1key (cdr (assoc 0 endata))) (redraw (cdr (assoc -1 endata)) 3) (cond ((= en1key "LWPOLYLINE") (setq entpp1 (dydd endata))) ((= en1key "LINE")(setq entpp1 (list (assoc 10 endata) (assoc 11 endata)))) ) (setq pt1 (cdr (nth 0 entpp1))) (setq pt2 (cdr (nth 1 entpp1))) (setq ang (/(* 180(+ (angle pt1 pt2) (* 0.5 pi))) pi)) (setq ang (strcat "<" (rtos ang 2 5))) (command "line" pause ang pause "") (redraw (cdr (assoc -1 endata)) 4) (prin1) ) ;;;dydd多义线顶点提取子程序 (defun dydd (ent / n pp endate key) (setq n 0) (setq pp '()) (repeat (length ent) (setq endate (nth n ent)) (setq key (car endate)) (if (= key 10) (setq pp (cons endate pp)) ) (setq n (+ n 1)) ) (reverse pp) ) |