Ðề: Visual Lisp
Làm như thế này bạn ơi!
(defun c:coord ( / e r)
(setq e (entget (car (entsel))))
;get the parent entity list
(setq r 1)
;set loop control number to 1
(while r
;while loop control is not nil, carry on looping
(setq e (entget (entnext (cdr (car e)))))
;get the vertex entity list
(if (/= (cdr (assoc 0 e)) "SEQEND")
;if it is not "end-of-sequence
(progn
;do the following
(princ (cdr (assoc 10 e)))
;print the co-ordinates
);progn
(setq r nil)
;if end of sequence, stop looping
);if
);while
);
entnext cho phép bạn lấy đoạn thẳng tiếp theo trong Polyline
Nguyên văn bởi tien2005
(defun c:coord ( / e r)
(setq e (entget (car (entsel))))
;get the parent entity list
(setq r 1)
;set loop control number to 1
(while r
;while loop control is not nil, carry on looping
(setq e (entget (entnext (cdr (car e)))))
;get the vertex entity list
(if (/= (cdr (assoc 0 e)) "SEQEND")
;if it is not "end-of-sequence
(progn
;do the following
(princ (cdr (assoc 10 e)))
;print the co-ordinates
);progn
(setq r nil)
;if end of sequence, stop looping
);if
);while
);
entnext cho phép bạn lấy đoạn thẳng tiếp theo trong Polyline
Ghi chú