本帖最后由 fangmin723 于 2024-4-9 12:12 编辑
整合lsp和dcl
支持一下上推荐
书写模式下,文字跟随光标移动代码如下,如有需要,自行替换:
- ;;书写模式
- (if (= edit_type 2)
- (progn
- (setq i -1 pt (cadr (grread T 15 0)))
- (while pt
- (setq txt_num (itoa (+ (atoi start_num) (* (setq i (1+ i)) (atoi inc_num)))))
- (if (= start_num "") (setq txt_num ""))
- (setq txt_new (strcat prefix txt_num suffix))
- (setq ent (entmakex (list '(0 . "TEXT") (cons 1 txt_new) (cons 7 txt_style) (cons 40 (atof txt_height)) (cons 10 pt) (cons 11 pt) '(71 . 0) '(72 . 4)))
- tdata (entget ent)
- )
- (while (and (setq gr (grread T 15 0)) (or (= (car gr) 5) (= (car gr) 2) (= (car gr) 11) (= (car gr) 25)))
- (if (= (car gr) 5)
- (progn
- (setq pt (cadr gr))
- (setq tdata (subst (cons 10 pt) (assoc 10 tdata) tdata) tdata (subst (cons 11 pt) (assoc 11 tdata) tdata))
- (entmod tdata)
- )
- (progn (entdel ent) (setq pt nil))
- )
- )
- )
- )
- )
|