- 积分
- 15341
- 明经币
- 个
- 注册时间
- 2002-2-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-2-13 15:06:00
|
显示全部楼层
只处理"polyline,line,lwpolyline"直线,含ARC的线不处理
;;注意:只处理"polyline,line,lwpolyline"直线,含ARC的线不处理
(defun C:TT (/ SS SS1 N N1 NN ENT CHECK TMP PT_LIST)
(defun DO_IT1 ()
(if (not
(member (setq TMP (cdr (assoc 10 (entget ENT)))) PT_LIST)
)
(setq PT_LIST (append PT_LIST (list TMP)))
)
(if (not
(member (setq TMP (cdr (assoc 11 (entget ENT)))) PT_LIST)
)
(setq PT_LIST (append PT_LIST (list TMP)))
)
)
(setq SS (ssget '((0 . "polyline,line,lwpolyline"))))
(setq PT_LIST '())
(setq N 0)
(repeat (sslength SS)
(setq ENT (ssname SS N))
(setq CHECK (cdr (assoc 100 (reverse (entget ENT)))))
(cond
((= CHECK "AcDbPolygonMesh")
(command "_.COPY" ENT "" "0,0" "@")
(command "_.EXPLODE" (entlast))
(setq SS1 (ssget ""))
(setq N1 0)
(repeat (sslength SS1)
(setq ENT (entget (ssname SS1 N1)))
(setq NN 0)
(repeat 4
(if
(not (member (setq TMP (cdr (assoc (+ 10 NN) ENT))) PT_LIST)
)
(setq PT_LIST (append PT_LIST (list TMP)))
)
(setq NN (1+ NN))
)
(setq N1 (1+ N1))
)
(command "_.ERASE" SS1 "")
)
((OR(= CHECK "AcDb3dPolyline")
(= (CDR (ASSOC 0 (ENTGET ENT))) "OLYLINE")
(= (CDR (ASSOC 0 (ENTGET ENT))) "LWPOLYLINE"))
(command "_.COPY" ENT "" "0,0" "@")
(command "_.EXPLODE" (entlast))
(setq SS1 (ssget ""))
(setq N1 0)
(repeat (sslength SS1)
(setq ENT (ssname SS1 N1))
(DO_IT1)
(setq N1 (1+ N1))
)
(command "_.ERASE" SS1 "")
)
(t
(DO_IT1)
)
)
(setq N (1+ N))
)
PT_LIST
) |
|