本帖最后由 vitalgg 于 2024-3-28 10:30 编辑
- (defun entity:make-mtext (str pt fontsize w h / ent-mtext)
- "创建多行文本"
- "ent"
- (setq ent-mtext (entmakex (list (quote (0 . "MTEXT"))
- (quote (100 . "AcDbEntity"))
- (quote (67 . 0))
- (quote (100 . "AcDbMText"))
- (cons 10 pt)
- (cons 40 fontsize)
- (cons 41 w)
- (quote (46 . 0.0))
- (quote (71 . 1))
- (quote (72 . 5))
- (cons 1 "pre mtext")
- (cons 7 (getvar "textstyle"))
- (quote (210 0.0 0.0 1.0))
- (quote (11 1.0 0.0 0.0))
- (cons 42 w)
- (cons 43 h)
- (quote (50 . 0.0))
- (quote (73 . 1))
- (quote (44 . 1.0)))))
- (vla-put-textstring (vlax-ename->vla-object ent-mtext)
- str)
- ent-mtext)
- (entdel(entity:make-mtext "str" '(0 0 0) 250 2500 500))
|