Forget my previous posts....
This little code, will know when a block was inserted (via: drag-&-drop, insert, a double-click from a palette or pasted) and if it has attributes, that are rotated, it will force to change them to be 0.0 (horizontal)
it is just a start - try to add more features or your own controls, and error handler - please.
Have fun.
;;8:08 PM 10/23/2007
(defun attsrotcontrol-event (reactor params / vla_block vla_atts)
(if (wcmatch
(car params)
"DROPGEOM,EXECUTETOOL,ACDCINSERTBLOCK,INSERT,PASTEBLOCK")
(progn (setq vla_block (vlax-ename->vla-object (entlast)))
(if (= (vla-get-hasattributes vla_block) :vlax-true)
(progn (setq vla_atts
(vlax-safearray->list
(vlax-variant-value (vla-getattributes vla_block))))
(mapcar (function
(lambda (att)
(if (> (vla-get-rotation att) 0.0) ;; add a better condition!
(vla-put-rotation att 0.0)))) ;; add a better rotation control!
vla_atts))))))
(defun attsrotcontrol-on ()
(if (not attsrotcontrol_reactor)
(setq attsrotcontrol_reactor
(vlr-editor-reactor
"attributes rotation control"
'((:vlr-commandended . attsrotcontrol-event)))))
(prompt "\nAttributes rotation control - enabled. \n")
(princ))
(defun attsrotcontrol-off ()
(if attsrotcontrol_reactor
(progn (if (vlr-added-p attsrotcontrol_reactor)
(vlr-remove attsrotcontrol_reactor))
(setq attsrotcontrol_reactor nil)
(prompt "\nAttributes rotation control - disabled. \n")))
(princ))
(defun C:ATTROTON () (attsrotcontrol-on) (princ))
(defun C:ATTROTOFF () (attsrotcontrol-off) (princ)) ;; EDIT added the off command...
(if (not (vl-bb-ref ':attsrotcontrol_banner))
(progn (vl-bb-set ':attsrotcontrol_banner t)
(princ "\n[ Attributes Rotation Control ] Loaded. \n")))
(princ)