只能更改LWPOLYLINE的点的排序:
 - (defun point2pline (lst)
- (entmake
- (append (list '(0 . "LWPOLYLINE")
- '(100 . "AcDbEntity")
- '(100 . "AcDbPolyline")
- (cons 90 (length lst))
- '(70 . 1)
- )
- (mapcar '(lambda (pt) (cons 10 pt)) lst)
- )
- )
- (entlast)
- )
- (defun loop(lst)
- (append (cdr lst)(list(car lst)))
- )
- (defun c:tt ()
- (setq lst (list (getpoint "第1点")
- (getpoint "第2点")
- (getpoint "第3点")
- )
- )
- (if(not(command "region"(point2pline lst)""))
- (command "region"(point2pline (loop lst))"")
- )
- )
|