试试看,它使用一条线作为刀刃,只用两个镐就可以沿着线走一圈。
- (defun c:trpls ( / x pt2 obj obj2 co-ords)
- (setq oldsnap (getvar "osmode"))
- (setvar "osmode" 0)
- (setq x -1)
- (setq obj (car (entsel "Pick cut line")))
- (setq pt2 (getpoint "pick offset direction"))
- (command "_offset" 1 obj pt2 "")
- (if (not co-ords2xy)(load "pline co-ords2"))
- (setq obj2 (entlast))
- (setq co-ords (getcoords obj2))
- (co-ords2xy) ; list of 2d points making pline
- (entdel obj2)
- (command "_TRIM" OBJ "" "F")
- (while (= (getvar "cmdactive") 1 )
- (repeat (length co-ordsxy)
- (command (nth (setq x (+ x 1)) co-ordsxy))
- )
- (command "")
- )
- (setq co-ordsxy nil) ; for next time
- )
|