hello
is there any way to fix this function so mtext can be placed at any ucs ?
similar code for vla-AddText works very well
vla-AddMText . Problem with rotation; =========================================================================================== ;
; Tworzy obiekt typu MTEXT / Creates a MTEXT object ;
; Space [VLA-Object] - kolekcja / collection | Model/Paper + Block Object ;
; Str [STR] - lancuch tekstowy / string ;
; Pb [LIST] - punkt bazowy / base point ;
; Width [REAL] - szerokosc tekstu / width text ;
; Rot [REAL] - kat obrotu w radianach / rotation angle in radians ;
; ------------------------------------------------------------------------------------------- ;
; (kr:ACX_AddMText (cd:ACX_ASpace) "NEW_MTEXT" (getpoint) 1.5 (/ pi 4)) ;
; =========================================================================================== ;
(defun kr:ACX_AddMText (Space Str Pb Width Rot / zdir xang obj)
(setq zdir (trans '(0 0 1) 1 0 T)
xang (angle '(0 0 0) (trans (getvar "UCSXDIR") 0 zdir))
)
(vla-put-rotation
(setq obj
(vla-AddMText (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object)))
(vlax-3d-point (trans Pb 1 0))
Width
Str
)
)
(+ Rot xang)
)
obj
)
thanks
kruuger