happlau 发表于 2018-4-15 09:55:31

求助

如何返回文本的旋转角度。谢谢

Andyhon 发表于 2018-4-15 11:14:56

组码 50
(50 . 0.523599)

happlau 发表于 2018-4-15 11:33:07

(defun c:ww(/ M_text dlang M_x M_y)
        (setq M_text (ssget))
        (setq dlang ???.rotation)        ;获取图元旋转角度
        (setq M_x sin(dlang)*5)                ;移动图元x
        (setq M_y cos(dlang)*5)                ;移动图元y
                        (command "move" M_text "" '(0 0 0) '(M_x M_y 0))
        (prin1)
)

happlau 发表于 2018-4-15 11:33:18

求大神帮助修改下

血司 发表于 2018-4-15 12:37:08

本帖最后由 血司 于 2018-4-15 14:18 编辑

(defun c:lxy (/ ent rad)
(setvar "OSMODE" 0)
(setq ent (car (entsel)))
(setq rad (Vlax-Get (Vlax-Ename->Vla-Object ent) 'Rotation ))            
(command "_move" ent "" (list 0 0) (list (* (sin rad) 5) (* (cos rad) 5)))
(princ)
)

happlau 发表于 2018-4-15 13:04:20

有效。谢谢
页: [1]
查看完整版本: 求助