试试使用entmake,下面是我以前使用的:
- (defun mktext1(:sty :str :pt10 :j72 :j73) ;写文字,参考实体
- (setq :sty (cdr (entget :sty))
- :pt10(trans :pt10 1 0)
- :sty (subst (cons 1 :str) (assoc 1 :sty) :sty)
- :sty (subst (cons 10 :pt10) (assoc 10 :sty) :sty)
- :sty (subst (cons 11 :pt10) (assoc 11 :sty) :sty)
- :sty (subst (cons 72 :j72) (assoc 72 :sty) :sty)
- :sty (subst (cons 73 :j73) (assoc 73 :sty) :sty)
- )
- (entmake :sty)
- )
- (defun mktext2(:str :pt10 :j72 / :sty) ;写文字
- (setq :pt10(trans :pt10 1 0))
- (entmake
- (list
- '(0 . "TEXT")
- (cons 1 :str)
- (cons 10 :pt10)
- (cons 11 :pt10)
- (cons 7 (setq :sty(getvar "textstyle")))
- (cons 40 (getvar "textsize"))
- (cons 41 (cdr (assoc 41 (tblsearch "style" :sty))))
- ; (cons 50 alf)
- (cons 51 (cdr (assoc 50 (tblsearch "style" :sty))))
- '(71 . 0)
- (cons 72 :j72)
- )
- )
- )
|