原始代码将采用当前textstyle的属性,但这将为您提供手动控制:
- (defun c:mpt (/ M-Point M-Text pt height rotation)
- (setq height 2.5 rotation 0.0) [color=Blue][b];; Text Height and Rotation[/b][/color]
- (defun M-Point (pt)
- (entmakex (list (cons 0 "POINT") (cons 10 pt))))
- (defun M-Text (pt val hgt rot)
- (entmakex (list (cons 0 "MTEXT")
- (cons 100 "AcDbEntity")
- (cons 100 "AcDbMText")
- (cons 10 pt)
- (cons 1 val)
- (cons 40 hgt)
- (cons 50 rot))))
- (while (setq pt (getpoint "\nPick Point: "))
- (M-Point (setq pt (trans pt 1 0)))
- (M-Text pt
- (apply 'strcat
- (mapcar 'strcat '("X = " "\nY = " "\nZ = ") (mapcar 'rtos pt)))
- height rotation))
- (princ))
|