See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Rotate selected attribute to zero degrees

  1. #1
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Rotate selected attribute to zero degrees

    Hi All
    I have the following routine that use to rotate visible attributes to zero degrees. It works well but occasionally when I am in a hurry and I miss the selection it locks up my session. I would like to add the necessary code to check that something valid has been selected. I tried the following code but it did not. Any help is greatly appreciated. Thanks.
    Manuel

    Code:
    (defun c:A0 (/ en)
    (if
      (and
       (setq en (car (entsel "\nSelect attribute to rotate: ")))
       (wcmatch (cdr (assoc 0 (entget en))) "ATTRIB")
      ) 
       (command ".attedit" "" "" "" "" en "" "a" "0" "")
    )
    (princ)
    )

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    1

    Default Re: Rotate selected attribute to zero degrees

    Hi,

    Please try the following routine that allows you to have multiple selection on Attributed blocks and ignores the invisible attributed to be rotated to zero degree.
    Code:
    (defun c:Test (/ sel int ent get)
      ;; Tharwat - Date: 24.04.2018	;;
      (and (princ "\nSelect attributed blocks to rotate: ")
           (setq sel (ssget "_:L" '((0 . "INSERT") (66 . 1))))
           (repeat (setq int (sslength sel))
             (setq ent (ssname sel (setq int (1- int))))
             (while (/= (cdr (assoc 0 (setq get (entget (setq ent (entnext ent)))))) "SEQEND")
               (or (= (cdr (assoc 70 get)) 1)
                   (entmod (subst '(50 . 0.0) (assoc 50 get) get)))
               )
             )
           )  
    (princ)
    )

  3. #3
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Re: Rotate selected attribute to zero degrees

    Thanks Tharwat. That works nicely. Take care.
    Manuel

  4. #4
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Rotate selected attribute to zero degrees

    Quote Originally Posted by cadconcepts View Post
    Thanks Tharwat. That works nicely. Take care.
    Manuel
    You are welcome anytime Manuel.

  5. #5
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Re: Rotate selected attribute to zero degrees

    Hi Tharwat
    Is it possible to only rotate the selected attribute? The way it is written, it changes all attributes values in a block. Thanks.
    Manuel

  6. #6
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Rotate selected attribute to zero degrees

    Yeah and here you go.
    Code:
    (defun c:Test (/ sel int get )
      ;; Tharwat - Date: 13.09.2022		;;
      (and (princ "\nSelect attributed blocks to rotate: ")
           (setq sel (nentsel "\nPick on attribute to rotate : "))
           (or (member '(0 . "ATTRIB") (setq get (entget (car sel))))
               (alert "Invalid object selected. Try again")
               )
           (entmod (subst '(50 . 0.0) (assoc 50 get) get))
             ) 
    (princ)
    )

  7. #7
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Re: Rotate selected attribute to zero degrees

    Hi Tharwat
    Thank you. I will give it a try.
    Manuel

Similar Threads

  1. Replies: 6
    Last Post: 2014-09-24, 08:11 AM
  2. 2014: Rotate Specific Plan 180 Degrees
    By Limbatus in forum Revit Architecture - General
    Replies: 2
    Last Post: 2014-04-29, 11:14 PM
  3. ACAD Mech 07 - Double-click Attribute to open editor on selected Attribute
    By svanderputten in forum AutoCAD Mechanical - General
    Replies: 5
    Last Post: 2012-01-25, 06:08 PM
  4. Rotate 90 Degrees
    By ntopliffe in forum Revit MEP - General
    Replies: 1
    Last Post: 2009-08-14, 01:05 AM
  5. PDF's rotate 90 degrees on output
    By BrenBren in forum AutoCAD Plotting
    Replies: 5
    Last Post: 2007-01-17, 09:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •