Jump to content

ENHANCED ATTRIBUTE EDITOR TEXT SET TEXT TO ANGLE 0


Efeezy

Recommended Posts

Is there a way to set the text angle to 0? I have tried multiple lisp and I cant get one that will work with our callouts on our blocks. I am using a have a flag note bock. Every time I rotate the block I have to double click and work in the Enhanced Attribute Editor. Does anyone have a fast way to fix this? I would like the text to always be set to angle 0.  

Link to comment
Share on other sites

41 minutes ago, Efeezy said:

I work with over 50 engineers and we have add on software. I was just looking for a answer. 

 

Did you look at the link? It will do what you are asking without a lisp.

Link to comment
Share on other sites

it didn't work sorry.  I found what I was looking for 🤩

 

ATTROT2 UDATES ALL BLOCKS TO ZERO TEXT ROTATION 
(defun C:ATTROT2 ( / obj att att_vla att_ss)
  (setvar "cmdecho" 0)
  (command "_.undo" "be")
  (if (not faopt) (setq faopt "Absolute"))
  (initget "Absolute Object Specify")
  (if (/= (setq faoptq (getkword (strcat "\nSpecify rotation [Absolute/Object/Specify] <" faopt ">: "))) nil)
    (setq faopt faoptq)
  )
  (cond
    ((= faopt "Absolute")
      (setq rot 0.0)
    )
    ((= faopt "Specify")
      (initget (+ 1 2 4))
      (setq rot (getint "\nSpecify attribute rotation angle: "))
    )
  )
  (setq ent (entsel "\nSelect block to update attribute rotation: "))
  (setq att_ss (ssget "X" (list (cons 0 "INSERT") (cons 2 (cdr (assoc 2 (entget (car ent))))) (cons 66 1))))
  (if att_ss
    (progn
      (while (/= (ssname att_ss 0) nil)
        (setq obj (ssname att_ss 0))
        (if (= faopt "Object")
          (setq rot (rtd (vla-get-rotation (vlax-ename->vla-object obj))))
        )
        (setq att (entnext obj))
        (while (and (/= att nil) (/= (cdr (assoc 0 (entget att))) "SEQEND"))
          (setq att_vla (vlax-ename->vla-object att))
          (vla-put-rotation att_vla (dtr rot))
          (setq att (entnext att))
        )
        (setq att_ss (ssdel obj att_ss))
      )
    )
  )
  (command "_.undo" "end")
  (setvar "cmdecho" 1)
  (princ)
)

;;;Degrees to Radians;;;
(defun dtr (ang)
  (* pi (/ ang 180.0))
)

;;;Radians to Degrees;;;
(defun rtd (ang)
  (/ (* ang 180.0) pi)
)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...