本帖最后由 xyp1964 于 2024-9-9 07:48 编辑
- (defun c:tt ()
- "指北针"
- (if (and (setq jd (getreal "\n角度: " ))
- (setq p1 (getpoint "\n插入点: "))
- )
- (progn
- (setvar "osmode" 0)
- (setq p2 (polar p1 0 1000))
- (command "line" p1 p2 "")
- (setq s1 (entlast)
- dr (* (/ jd 180.) pi)
- p3 (polar p1 (- dr) 1000)
- p4 (polar p1 (- dr) 1200)
- p5 (polar p1 (*(- dr)0.5) 600)
- )
- (command "line" p1 p3 "")
- (setq s2 (entlast))
- (command "chprop" s2 "" "c" 1 "")
- (command "text" "j" "mc" p4 300 0 "N")
- (command "dimangular" (list s2 p3)(list s1 p2) p5)
- )
- )
- (princ)
- )
|