(if (setq ssetPLine (ssget "_:S:E" '((0 . "LWPOLYLINE")))) ;ask user to select a polyline
(progn
(setq listPLine (entget (ssname ssetPLine 0)) ;retrive entity's list
listCorners '())
(while (setq listPLine (member (assoc 10 listPLine) listPLine)) ;cycle until all vertexes (corners) were found
(setq listCorners (cons (cdar listPLine) ;and retain them in a list
listCorners)
listPLine (cdr listPLine)) ;skip first entry to allow locating next vertex
)
(print (inters (nth 0 listCorners) (nth 2 listCorners) ;get intersection of diagonals
(nth 1 listCorners) (nth 3 listCorners)))
)
)
请注意,以上仅适用于矩形;稍后您需要添加SSGET筛选器(请检查Tharwat的代码)或选择后验证。 这对我来说太棒了,谢谢你的解释:D
不客气,Rain0923!祝你学习顺利。
页:
1
[2]