本帖最后由 lisperado 于 2020-6-1 01:56 编辑
也许我搞错?是指斜度吗? 因为 1/1=1或100%, (atan 1) 转换为45度。
command命令版
 - (setq *slope%* 2.5); 默认值
- (defun c:ddan ( / ang n )
- (setq n (getreal (strcat "\n输入斜度 <"(rtos *slope%* 2 2)"%>? : ")))
- (setq *slope%* (if n n *slope%*))
- (command "LINE" "\\" (strcat "@2000<"(angtos (atan (* 1e-2 *slope%*) ) 1 8)))
- (princ)
- )
entmake版 2000长度是以X-axis做标准?
 - (setq *slope%* 2.5); 默认值
- (defun c:ddan1 (/ ang n pt)
- (and (setq n (getreal (strcat "\n输入斜度 <" (rtos *slope%* 2 2) "%>? : "))
- *slope%* (if n n *slope%*)
- )
- (setq pt (getpoint "\n线起点 : "))
- (setq ang (atan (* 1e-2 *slope%*)) pt (trans pt 1 0))
- (entmake
- (list '(0 . "LINE") (cons 10 pt) (cons 11 (polar pt ang (abs (/ 2000. (cos ang))))) )
- )
- )
- (princ)
- )
|