Visual LISP, AutoLISP and General Customization

Reply
*Expert Elite*
braudpat
Posts: 1,871
Registered: ‎12-15-2006
Message 11 of 12 (127 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

Valued Contributor
rodb
Posts: 88
Registered: ‎03-24-2009
Message 12 of 12 (119 Views)

Re: rotating attribute text horizontal

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

Thanks for that, an interesting option!

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community