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
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
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
RE: LSP FOR SWAPPING ATTRIBUTES WITHIN THE SAME BLOCK
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)