- ;;简单写写供参考,NO ERROR CHECK
- (defun C:TT (/ HOLDOSMODE ENT PT1 PT2 NUM ANG DIST DIST1)
- (setq HOLDOSMODE (getvar "OSMODE"))
- (if (setq ENT (ssget))
- (progn
- (setvar "osmode" 39)
- (setq PT1 (getpoint "\n基准点: "))
- (setq PT2 (getpoint PT1 "\n第2点: "))
- (setq NUM (getint "\nNumber of segments:"))
- (setq ANG (angle PT1 PT2))
- (setq DIST (/ (distance PT1 PT2) NUM)
- DIST1 DIST
- )
- (setvar "osmode" 0)
- (repeat NUM
- (setq PT2 (polar PT1 ANG DIST))
- (command "._COPY" ENT "" PT1 PT2)
- (setq DIST (+ DIST DIST1))
- )
- (princ "\nDistance:")
- (princ DIST1)
- )
- )
- (setvar "osmode" HOLDOSMODE)
- (princ)
- )
|