这可能会帮助你实现你的目标。
- (defun c:test (/ ss e p1 p2 ent)
- ; Tharwat 14. 05. 2011
- (if (and (setq ss (entsel "\n Select One Line :"))
- (eq (cdr (assoc 0 (setq e (entget (car ss))))) "LINE")
- )
- (progn
- (if (> (car (setq p1 (cdr (assoc 10 e))))
- (car (setq p2 (cdr (assoc 11 e))))
- )
- (progn
- (setq ent (entmakex
- (list (cons 0 "LINE") (cons 10 p2) (cons 11 p1))
- )
- )
- (command "_.matchprop" ss ent "")
- (command "_.ucs" "_e" ent)
- (command "_.dimlinear" "" ss pause)
- (entdel (car ss))
- )
- (progn
- (command "_.ucs" "_e" ss)
- (command "_.dimlinear" "" ss pause)
- )
- )
- )
- (princ "\n Please select line only")
- )
- (princ)
- )
塔瓦特 |