Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

LSP FOR SWAPPING ATTRIBUTES WITHIN THE SAME BLOCK

Status
Not open for further replies.

CadDraftee

Mechanical
Sep 16, 2003
48
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
 
Replies continue below

Recommended for you

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.
 
Yes please - willing to giving ago that may help weather be now or down the track.
 
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)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor