lingduwx 发表于 2015-10-5 20:27
首先,谢谢E大,E大的程序感觉非常棒,下面还有个小小的要求麻烦E大再修改一下就更好了,谢谢了!
现有 ...
加空字符,注意不是空格,
- (defun c:tt()
- (defun r2d (rad) (* (/ rad pi) 180.0))
- (if (and (setq p1 (getpoint "\n起点<退出>: "))
- (setq p2 (getpoint p1 "\n终点<退出>: "))
- )
- (progn
- (setq ds (distance p1 p2)
- aa (r2d (angle p1 p2))
- dx (- (car p2) (car p1))
- dy (- (cadr p2) (cadr p1))
- )
- (setq str (strcat "距离="
- (rtos ds 2)
- "; X="
- (rtos dx 2)
- "; Y="
- (rtos dy 2)
- "; XY倾角="
- (rtos aa 2)
- "; "
- )
- )
- (Vlax-Invoke-Method (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'SendCommand str)
- (Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "{Esc}")
- )
- )
- )
llsheng_73的加空字符。
- (defun c:tt (/ p1 p2 r2d)
- (defun r2d (rad) (* (/ rad pi) 180))
- (if (if (setq p1 (getpoint "\n起点<退出>: "))
- (setq p2 (getpoint p1 "\n终点<退出>: "))
- )
- (mapcar 'Vlax-Invoke
- (list (Vla-Get-ActiveDocument (Vlax-Get-Acad-Object))
- (Vlax-Get-Or-Create-Object "WScript.Shell")
- )
- '(SendCommand Sendkeys)
- (list (apply 'strcat
- (mapcar 'strcat
- '("距离=" "; X=" "; Y=" "; " )
- (mapcar 'rtos
- (list (distance p1 p2)
- (- (car p2) (car p1))
- (- (cadr p2) (cadr p1))
- (r2d (angle p1 p2))
-
- )
- )
- )
- )
- "{Esc}"
- )
- )
- )
- )
|