Try using SETQ rather than SETVAR
and drop the extra set of ( ).
(setq objang (rtd (vlax-get obj 'rotation)))
For the UCS part, have a look at the TRANS function.
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"haojan" wrote in message
news:17808646.1077743175142.JavaMail.jive@jiveforum2.autodesk.com...
> Thanx Jason but I get some error
>
> For
> (defun c:robj ()
> (setq obj (car (entsel "\nselect object: ")))
> (setq obj (vlax-ename->vla-object obj))
> (setvar objang ((rtd (vlax-get obj 'rotation))))
> (princ "/n")
> (princ objang)
> )
> I get
> select object: ; error: bad function: 145.152
>
> For
> (defun c:robj ()
> (setq obj (car (entsel "\nselect object: ")))
> (setvar objang (rtd (cdr (assoc 50 (entget obj)))))
> (princ "/n")
> (princ objang)
> )
> I get
> select object: ; error: bad argument type: (or stringp symbolp): nil
>
> Also this rotation seems to be based on the WCS. I was actually looking more for the
rotation based on the UCS.
>
> I am trying to rotate the objects (typically lines of DText) in one simple step to 0
based on the UCS. Hope you can help. Thank You.