forked from xplan001/AutoCad-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path批量注记直线的长度.lsp
27 lines (27 loc) · 836 Bytes
/
批量注记直线的长度.lsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;;;;ÅúÁ¿×¢¼ÇÖ±Ïߵij¤¶È
(defun c:plbz()
(vl-load-com)
(setq line (ssget))
(setq i 0)
(repeat (sslength line)
(setq ent1(ssname line i))
(setq txt(Vlax-Ename->Vla-Object ent1))
(Setq minc (Vlax-Get txt 'ObjectName ))
(if (= minc "AcDbLine")
(progn
(Setq leng_txt (Vlax-Get txt 'Length ))
(Setq ang_txt (Vlax-Get txt 'Angle ))
(Setq pt1 (Vlax-Get txt 'StartPoint ))
(Setq pt2 (Vlax-Get txt 'EndPoint ))
(setq pt3 (mapcar '(lambda (x y)
(+(/ (- y x)2) x)
)
pt1 pt2
)
)
(command "text" "j" "bc" pt3 "5" (*(/ ang_txt pi)180) (rtos leng_txt 2 3))
)
)
(setq i(1+ i))
)
)