画线表示不理解,跟论坛中“提取图层名字”,是相同用法
- ;;提取图层名字
- (defun C:tcn (/ LST N PT)
- (setvar "cecolor" "bylayer")
- (setq LST (reverse (TABLE "LAYER")))
- (setq PT (getpoint "文字插入點: ")
- N 0
- )
- (foreach NAME LST
- (entmake (list '(0 . "TEXT") (cons 8 NAME) '(100 . "AcDbText") (cons 10
- (list
- (car PT)
- (-
- (cadr PT) N
- )
- )
- ) '
- (40 . 6) (cons 1 NAME)
- )
- )
- (setq N (+ N 10.0))
- )
- (princ)
- )
- (defun TABLE (S / D R)
- (while (setq D (tblnext S (null D)))
- (setq R (cons (cdr (assoc 2 D)) R))
- )
- )
|