×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

LSP FOR SWAPPING ATTRIBUTES WITHIN THE SAME BLOCK

LSP FOR SWAPPING ATTRIBUTES WITHIN THE SAME BLOCK

LSP FOR SWAPPING ATTRIBUTES WITHIN THE SAME BLOCK

(OP)
HELP!! Please!!!

Once upon a time I had a lsp program that would swap attributes within the same block.
Does anyone have a program that does similar?
Basically all I need is to be able to pick “attribute 1” and swap the contents of it with the contents of “attribute 4”.
Very convenient for use in a title block for example when you type in all your revision history in the wrong place and don't want to re-type it in again.

If anyone has a program like this I would appreciate greatly.

Regards
Mel

RE: LSP FOR SWAPPING ATTRIBUTES WITHIN THE SAME BLOCK

Hi, Mel:

I don't have such a program, but I have a lisp routine that copies the content of a text, no matter if text, attribute or in a block, into another text. No mtext is allowed, though.

If you still need it, send me an e-mail.

Roberto.

RE: LSP FOR SWAPPING ATTRIBUTES WITHIN THE SAME BLOCK

(OP)
Yes please - willing to giving ago that may help weather be now or down the track.

RE: LSP FOR SWAPPING ATTRIBUTES WITHIN THE SAME BLOCK

Hi, Mburfitt:

Here's the code:

(defun COPYTEXT (/ TEXTO1 F1 TEXTO2 TXT2 PEGAR)

   (setq TEXTO1 (car (nentsel "\nChoose text to copy: ")))
   (setq TEXTO1 (entget TEXTO1))
   (setq F1 (cdr(assoc 0 TEXTO1)))
   (if (or(= F1 "TEXT")(= F1 "ATTRIB"))
      (progn
         (setq TEXTO1 (assoc 1 TEXTO1))
         (princ (strcat "\t" (cdr TEXTO1)))
         (setq TEXTO2 (car (nentsel "\nChoose text to modify: ")))
         (setq TXT2 (entget TEXTO2))
         (setq F1 (cdr(assoc 0 TXT2)))
         (if (or(= F1 "TEXT")(= F1 "ATTRIB"))
            (progn
               (setq PEGAR (assoc 1 TXT2))
               (princ (strcat "\t" (cdr PEGAR)))
           (setq TXT2 (subst TEXTO1 PEGAR TXT2))
               (entmod TXT2)
               (entupd TEXTO2)
               (princ (strcat "\tChanged to " (cdr TEXTO1) "."))
        )
            (princ "\nSelected object is not text or attribute.")
         )
      )
      (princ "\nSelected object is not text or attribute.")
   )
(princ)
)
(defun c:CT () (COPYTEXT))
(princ "\nCall routine with CT")
(princ)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources