换掉了两个command 我是07 原来的运行起来也不太兼容
- (defun c:mm4(/ bf-curve-length jg lm-entmake-text n num1 num2 pt ss ss2 ty xx zc)
- (defun BF-curve-Length (curve)
- (vlax-curve-getDistAtParam
- curve
- (vlax-curve-getEndParam curve)
- )
- )
- (defun lm-entmake-text(tdata / pt wz gd co tc)
- (mapcar'set '(pt wz gd co tc) tdata)
- (or co (setq co 256))
- (or tc (setq tc (getvar "clayer")))
- (entmake(list '(0 . "text")(cons 8 tc)(cons 62 co)'(50 . 0.0) (cons 10 pt)(cons 11 pt)(cons 1 wz)'(7 . "Standard")(cons 40 gd)'(6 . "Continuous")'(41 . 0.8)'(72 . 1)'(210 0.0 0.0 1.0)'(100 . "AcDbText")'(73 . 2)))
- (entlast)
- )
- (setq ss (ssget '((0 . "*LINE,CIRCLE,ARC") (-4 . "<NOT") (6 . "bylayer") (-4 . "NOT>") (-4 . "<NOT") ( 6 . "byblock") (-4 . "NOT>"))))
- (setq pt (getpoint "指定统计结果写入位置:"))
- (setq num1 (sslength ss) num2 0)
- (while (/= num1 num2)
- (setq
- ty (ssname ss 0)
- xx (cdr (assoc 6 (entget ty)))
- ss2 (ssget "p" (list (cons 6 xx)))
- zc 0
- n 0
- )
- (repeat (sslength ss2)
- (setq ty (ssname ss2 n))
- (setq zc (+ zc (BF-curve-Length ty)))
- (setq n (+ n 1))
- )
- (setq jg (strcat xx "=" (rtos (/ zc 1000) 2 2) "米"))
- (lm-entmake-text (list pt jg 60))
- (setq pt (polar pt (* pi 1.5) 120))
- (setq num2 (+ num2 (sslength ss2)))
- (command "Select" ss "R" ss2 "")
- (setq ss (ssget "_P"))
- )
- )
|