วันพุธที่ 20 มีนาคม พ.ศ. 2567

Change text attributes

CHange Text ATTributes 


 ;|

Edit width factor text height 

and rotation of attributes text

Create and Design by AutolispTH March 2024

|;

;;-----radial to dreegee

(defun rtod (x)

       (/ (* x 180) pi)

)

(defun dtor (x)

       (* x (/ pi 180))

)

(defun C:CHTAtt ( / e ent)

(vl-load-com)

(setq old_cmdecho  (getvar "cmdecho"))

(setvar "cmdecho" 0)

;-------------------width factor-----------------------------+

(or wd (setq wd 1.0))

 (setq wdtemp

        (getDist (strcat "\nEnter width factor of text: <"

                           (rtos wd 2 2)

                             ">: "

                ) 

        ) 

)

(and wdtemp (setq wd wdtemp))

;-------------------text height------------------------------+

(or th (setq th 1.0))

 (setq thtemp

        (getDist (strcat "\nEnter text height: <"

                           (rtos th 2 2)

                             ">: "

                ) 

        ) 

)

(and thtemp (setq th thtemp))

;--------------------text rotation---------------------------+

(or ro (setq ro 0.0))

 (setq rotemp

        (getDist (strcat "\nEnter text rotation: <"

                           (rtos ro 2 2)

                             ">: "

                ) 

        ) 

)

(and rotemp (setq ro rotemp))

;--------------------------------------------------------------+

(while (setq e (car (nentsel "\n Select an attribute to change:")))

(setq ent (vlax-ename->vla-object e))

(vla-put-scalefactor ent wd)

(vla-put-height ent th)

(vla-put-Rotation ent (dtor ro))

(princ)

)

(setvar "cmdecho" old_cmdecho)

(princ)

)

(prompt "\n\t\t\t  +------------------------------------------+\n")

(prompt "\n\t\t\t  |      Start with CHTATT to execute        |\n")

(prompt "\n\t\t\t  +------------------------------------------+\n")

ไม่มีความคิดเห็น:

แสดงความคิดเห็น