Results 1 to 9 of 9

Thread: Match Text Properties Without Affecting Rotation

  1. #1
    100 Club
    Join Date
    2012-08
    Posts
    111
    Login to Give a bone
    0

    Cool Match Text Properties Without Affecting Rotation

    Hi guys,

    When you match the properties from one piece of text to another by default it matches the rotation angle and text size. If you simply want to match the layer of one piece of text to another without affecting other text properties such as rotation angle.

    Regards.

  2. #2
    100 Club
    Join Date
    2012-08
    Posts
    111
    Login to Give a bone
    0

    Default Re: Match Text Properties Without Affecting Rotation

    Hey all,

    Problem solved.
    I've found one at the Cadalyst site. It didn't mention the author but this lisp is great!

    I'll posted the code below. And if you have a other code, please post too.

    Thanks

    Code:
    ;*****************************************************************************
    ;                          TTT.LSP
    ;This program changes a selected text string to match any other selected text
    ;string.
    ;*****************************************************************************
    
    (DEFUN C:TTT ()
    
       (SETQ ED(ENTGET (CAR (NENTSEL "\nPick TEXT to change:"))))
       (SETQ EL (ENTGET (CAR (NENTSEL "\nPick TEXT to match:"))))
     (COMMAND "CMDECHO" "1")
      (SETQ ED (SUBST (CONS 7 (CDR (ASSOC 7 EL)))
                     (ASSOC 7 ED)
                    ED
       )
     )
    (ENTMOD ED)
      (SETQ ED (SUBST (CONS 40 (CDR (ASSOC 40 EL)))
                     (ASSOC 40 ED)
                    ED
       )
    )
    
    (ENTMOD ED)
      (SETQ ED (SUBST (CONS 8 (CDR (ASSOC 8 EL)))
                     (ASSOC 8 ED)
                    ED
       )
    )
    (ENTMOD ED)
    (SETQ ED (SUBST (CONS 51 (CDR (ASSOC 51 EL)))
                    (ASSOC 51 ED)
                    ED
       )
    )
    (ENTMOD ED)
    )

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

    Default Re: Match Text Properties Without Affecting Rotation

    Try this Billy

    Code:
    (defun c:Test (/ s ent ss i e)
      (if (and (setq s (car (entsel "\n Select Single text :")))
               (wcmatch (cdr (assoc 0 (setq ent (entget s)))) "*TEXT")
               (progn (prompt " Select Texts to match ... ")
                      (setq ss (ssget "_:L" '((0 . "*TEXT"))))
               )
          )
        (repeat (setq i (sslength ss))
          (setq e (entget (ssname ss (setq i (1- i)))))
          (entmod
            (append e (list (assoc 7 ent) (assoc 40 ent) (assoc 8 ent)))
          )
        )
      )
      (princ)
    )

  4. #4
    100 Club
    Join Date
    2012-08
    Posts
    111
    Login to Give a bone
    0

    Default Re: Match Text Properties Without Affecting Rotation

    Hi Tharwat.
    Good one. I've tested and worked perfect!

    Thank you.

    I have one question.
    Why the lisp match the layer and the height, but don't match the width??

    Regards

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

    Default Re: Match Text Properties Without Affecting Rotation

    Quote Originally Posted by BILLYJOW View Post
    Hi Tharwat.
    Good one. I've tested and worked perfect!

    Thank you.
    You're welcome .

    Quote Originally Posted by BILLYJOW View Post
    I have one question.
    Why the lisp match the layer and the height, but don't match the width??

    Regards
    Because that follows the Text Style

  6. #6
    100 Club
    Join Date
    2012-08
    Posts
    111
    Login to Give a bone
    0

    Default Re: Match Text Properties Without Affecting Rotation

    Because that follows the Text Style
    I get it, Tharwat.

    Thank you again.

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

    Default Re: Match Text Properties Without Affecting Rotation

    Quote Originally Posted by BILLYJOW View Post
    I get it, Tharwat.

    Thank you again.
    Enjoy it .....

  8. #8
    Member
    Join Date
    2015-05
    Posts
    3
    Login to Give a bone
    0

    Default Re: Match Text Properties Without Affecting Rotation

    Quote Originally Posted by Tharwat View Post
    Try this Billy

    Code:
    (defun c:Test (/ s ent ss i e)
      (if (and (setq s (car (entsel "\n Select Single text :")))
               (wcmatch (cdr (assoc 0 (setq ent (entget s)))) "*TEXT")
               (progn (prompt " Select Texts to match ... ")
                      (setq ss (ssget "_:L" '((0 . "*TEXT"))))
               )
          )
        (repeat (setq i (sslength ss))
          (setq e (entget (ssname ss (setq i (1- i)))))
          (entmod
            (append e (list (assoc 7 ent) (assoc 40 ent) (assoc 8 ent)))
          )
        )
      )
      (princ)
    )

    Hi,

    Sorry to hi-jack this thread and in what appears to be fairly old, but I cannot seem to find the similar solution elsewhere.

    Is it possible to match text rotation only and NOT all other properties?

    I assume a simple adjustment of the above Lisp but unfortunately, I don't understand Lisps at all

    Thanks for any help.

    Rroger_D

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

    Default Re: Match Text Properties Without Affecting Rotation

    Quote Originally Posted by Rroger_D View Post
    Is it possible to match text rotation only and NOT all other properties?
    Replace this:

    Code:
    (entmod (append e (list (assoc 7 ent) (assoc 40 ent) (assoc 8 ent))))
    With this:

    Code:
    (entmod (append e (list (assoc 50 ent))))

Similar Threads

  1. Match text coordinate and rotation
    By Arterius in forum AutoLISP
    Replies: 10
    Last Post: 2015-02-20, 08:04 AM
  2. Match TEXT properties with assoc on/off toggles
    By christopherh1424831 in forum API Wish List
    Replies: 0
    Last Post: 2012-09-18, 01:24 AM
  3. Match Properties
    By mlf in forum AutoCAD General
    Replies: 9
    Last Post: 2009-02-22, 02:54 PM
  4. AutoCAD - DWF output rotation doesn't match sheet rotation
    By ttaylor.62786 in forum AutoCAD Plotting
    Replies: 3
    Last Post: 2007-02-16, 12:24 AM
  5. Match properties - Text width and justification
    By neilcheshire in forum AutoCAD General
    Replies: 2
    Last Post: 2005-06-23, 11:41 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
  •