Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Expert Elite*
braudpat
Posts: 2,404
Registered: ‎12-15-2006
Message 11 of 12 (146 Views)

Re: rotating attribute text horizontal

01-18-2013 09:25 AM in reply to: rodb

 

Hello

 

An other routine : a little bit different that I am using sometimes !

coming from a french forum www.cadxp.com (Author: Patrick_35)

 

ROT0 : all attributs will be horizontal for the next insert ...

 

SROT0 : disable this special feature for the next insert ...

 

Bye, Patrice 

 

 

;;;
;;;=================================================================
;;;
;;; ROT_0.LSP v2.00
;;;
;;; Laisser l'Angle de Rotation à 0 de TOUS les attributs
;;;
;;; Copyright (C) Patrick_35
;;;
;;;=================================================================
;;;
;;; Commande :   ROT0   Pour mettre les Attributs a l'horizontale
;;;
;;; Commande :  SROT0   Pour revenir a la NORMALE ...
;;;


(defun Attributs_rot_0(rea obj / att)
  (cond
    ((eq (cdr (assoc 0 (entget (cadr obj)))) "INSERT")
      (foreach att (vlax-invoke (vlax-ename->vla-object (cadr obj)) 'getattributes)
	(vla-put-rotation att 0)
      )
    )
  )
)


(defun c:rot0()
  (if mrea_rot0
    (princ "\n\tL'Angle des Attributs = 0 est déjà activée ")
    (progn
      (setq mrea_rot0 (vlr-acdb-reactor nil '((:vlr-objectModified . Attributs_rot_0)(:vlr-objectAppended . Attributs_rot_0))))
      (princ "\n\tActivation de l'Angle des Attributs à 0 ")
    )
  )
  (princ)
)


(defun c:srot0()
  (if mrea_rot0
    (progn
      (vlr-remove mrea_rot0)
      (setq mrea_rot0 nil)
      (princ "\n\tDésactivation de l'Angle = 0 des Attributs ")
    )
    (princ "\n\tL'Angle des Attributs = 0 est déjà désactivé ")
  )
  (princ)
)


(vl-load-com)
(princ (strcat "\n\tPour activer l'Angle des Attributs à 0, lancez la commande ROT0 \n\tPour revenir à la NORMALE, faites la commande SROT0 "))
(princ)

 

 

 

 

 

Bye, Pat ( Supporting Troops )
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Compliment) - Thanks
Valued Contributor
rodb
Posts: 97
Registered: ‎03-24-2009
Message 12 of 12 (138 Views)

Re: rotating attribute text horizontal

01-18-2013 10:03 AM in reply to: braudpat

Thanks for that, an interesting option!

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.