А зачем вообще при программировании знать какие-то переменные, "отвечающие" за угол поворота текста? Не нужно это вообще!
Есть текстовый стиль, но это для пользователей, а не для программистов. Программно создаются текстовые примитивы. Часть свойств у них принимается по умолчанию из текущего текстового стиля. Например, угол наклона, шрифт. Но само значение текстовой строки, угол поворота и высота должны задаваться программой.
Если использовать для текста функцию command (vl-cmdf), то надо заглядывать в описание стиля, чтобы передать нужное количество аргументов. Например:
(defun ru-text-draw (txt pnt height rotation justification)
(ru-var-clear-osnap)
(if (= (cdr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE"))))
0.0
) ;_ end of =
(progn
;; нулевая высота текста
(if justification
(vl-cmdf "_.TEXT" "_J" justification pnt height rotation txt)
(vl-cmdf "_.TEXT" pnt height rotation txt)
) ;_ end of if
) ;_ end of progn
(progn
;; фиксированнная высота
(if justification
(vl-cmdf "_.TEXT" "_J" justification pnt rotation txt)
(vl-cmdf "_.TEXT" pnt rotation txt)
) ;_ end of if
) ;_ end of progn
) ;_ end of if
(ru-lw-set-for-ent (entlast) (ru-lw-calc-for-text height))
(ru-var-restore-osnap)
(entlast)
)
Здесь еще применены функции отключения и восстановления объектной привязки и установка "правильного" веса линии. Но угол поворота передается аргументом.
А это вариант создания текста объектным методом (предпочтительный):
(defun ru-text-add (txt pnt height rotation justification / obj)
;|
justification:
0 acAlignmentLeft
1 acAlignmentCenter
2 acAlignmentRight
3 acAlignmentAligned
4 acAlignmentMiddle
5 acAlignmentFit
6 acAlignmentTopLeft
7 acAlignmentTopCenter
8 acAlignmentTopRight
9 acAlignmentMiddleLeft
10 acAlignmentMiddleCenter
11 acAlignmentMiddleRight
12 acAlignmentBottomLeft
13 acAlignmentBottomCenter
14 acAlignmentBottomRight
|;
(if (null justification)
(setq justification acalignmentleft)
) ;_ end of if
(ru-error-catch
(function
(lambda ()
(setq
obj
(vla-addtext
(ru-obj-active-space)
txt
(if
(or (= justification acalignmentaligned)
(= justification acalignmentfit)
) ;_ end of or
(vlax-3d-point (car pnt))
(vlax-3d-point pnt)
) ;_ end of if
height
) ;_ end of vla-AddText
) ;_ end of setq
(ru-lw-set-for-obj obj (ru-lw-calc-for-text height))
(cond
((= justification acalignmentleft)
(vla-put-rotation obj rotation)
)
((or (= justification acalignmentaligned)
(= justification acalignmentfit)
) ;_ end of or
(vla-put-alignment obj justification)
(vla-put-textalignmentpoint
obj
(vlax-3d-point (cadr pnt))
) ;_ end of vla-put-textalignmentpoint
)
(t
(vla-put-alignment obj justification)
(vla-put-textalignmentpoint obj (vlax-3d-point pnt))
(vla-put-rotation obj rotation)
)
) ;_ end of cond
(vla-update obj)
obj
) ;_ end of lambda
) ;_ end of cond
(function (lambda (x) (princ (strcat "\nОШИБКА RU-TEXT-ADD: " x)) nil))
) ;_ end of ru-error-catch
) ;_ end of defun
Здесь поворот задается также аргументом
И вариант создания текста через entmake
(defun ru-text-entmake (txt pnt height rotation justification / ent_list)
(setq ent_list (list '(0 . "TEXT")
'(100 . "AcDbEntity")
'(100 . "AcDbText")
(list 10 (car pnt) (cadr pnt) 0.0)
(cons 1 txt)
(cons 40 height)
;;(cons 7 "RU_CAD")
(if justification
(cond
((= justification "C")
'(72 . 1)
)
((= justification "R")
'(72 . 2)
)
((= justification "A")
'(72 . 3)
)
((= justification "M")
'(72 . 4)
)
((= justification "F")
'(72 . 5)
)
(t
'(72 . 0)
)
) ;_ end of cond
'(72 . 0)
) ;_ end of if
(cons 50 rotation)
(list 11 (car pnt) (cadr pnt) 0.0)
) ;_ end of list
) ;_ end of setq
(setq ent_list (entmake ent_list))
(ru-lw-set-for-ent (entlast) (ru-lw-calc-for-text height))
(entlast)
)