马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
给定两点和弦长画圆弧

- (defun C:TT (/ P1 P2 DS DI A1 A2 AM RE N)
- (defun MKARC_SEA (P1 P2 ANG / E)
- (vl-load-com)
- (command "arc" "non" P1 "e" "non" P2 "d" "non" (polar P1 (+ ANG (angle P1 P2)) 1000))
- (setq E (entlast))
- (list (vlax-curve-getdistatparam E (vlax-curve-getendparam E)) E))
- (setq P1 (getpoint "\圆弧起点:")
- P2 (getpoint "\圆弧终点:")
- DS (distance P1 P2))
- (princ (strcat "\n弦长:" (rtos DS 2 4)))
- (while (not (and (setq DI (getreal "\n输入弧长:")) (> DI DS)))(princ "\n无效输入!"))
- (setq A1 0 A2 3.1415926 N 0)
- (while (and (setq RE (MKARC_SEA P1 P2 (setq AM (/ (+ A1 A2) 2.0))))
- (not (equal DI (car RE) 1e-10)))
- (if (> (car RE) DI)
- (setq A2 AM)
- (setq A1 AM))
- (entdel (cadr RE))
- (setq N (1+ N)))
- (print N)
- (if (getpoint "\n反向?")(command "mirror" (cadr re) "" "non" p1 "non" p2 "y"))
- (princ))
- (princ "\n给定两点和弦长画圆弧 by wkai from XDCAD.net")
- (princ "\n命令:TT")
|