ILoveMadoka Posted July 28, 2010 Posted July 28, 2010 (edited) Oops! - Header should read " Help Modifying Text Width Lisp " I don't know where this code originated (It's pretty old...) but can someone *PLEASE* help me modify it to also work with MTEXT and DIMENSIONS? -Edit 7.29.2010 **After some research, screw MTEXT!! - not worth the hassle! ** I just need it to work with the various dimensions. Associative, Multileader, etc. (DEFUN C:TW (/ P OPTION NSTYLE NWIDTH L N E) (PROMPT "\nChanges text width: ") (setvar "cmdecho" 0) (graphscr) (command "undo" "m") (Prompt "\nSelect text to be changed: ") (setq olderr *error* *error* cterr) (setq p (ssget)) (SETQ OPTION "Width") (cond ((eq option "Width") (setq nwidth (getreal "\nEnter new width for text: ")))) (if p (progn (setq l 0 n (sslength p)) (while (< l n) (if (= "TEXT" (cdr (assoc 0 (setq e (entget (ssname p l)))))) (progn (cond ((eq option "Width") (setq e (subst (cons 41 nwidth) (assoc 41 e) e)))) (entmod e))) (setq l (1+ l))))) (princ)) While I would like to know HOW to modify this code, if there is another routine better suited to change the text width of any "text-related" entities I am open to such as well... Thanks!! Edited July 29, 2010 by ILoveMadoka edit Quote
Tharwat Posted July 28, 2010 Posted July 28, 2010 Hi The following is the same as yours ; (DEFUN C:TW (/ p nwidth l n e) (PROMPT "\nChanges text width: ") (setq p (ssget '((0 . "TEXT")))) (setq nwidth (getint "\nEnter new width for text: ")) (if (/= p nil) (progn (setq l 0 n (sslength p)) (while (< l n) (setq e (entget (ssname p l))) (entmod (setq e(subst (cons 41 nwidth) (assoc 41 e) e)) ) (setq l (1+ l)))) ) (princ) ) So the (assoc 41) in Mtext is not the same as Text please check DXF for more information. Tharwat Quote
ILoveMadoka Posted July 28, 2010 Author Posted July 28, 2010 Thank you, but that's not what I'm asking. If I could write the code myself I wouldn't be asking here... I'm trying to avoid asking the gods here directly for their assistance.. thanks though.. Quote
alanjt Posted July 28, 2010 Posted July 28, 2010 I'm trying to avoid asking the gods here directly for their assistance.. :lol: Quote
Tharwat Posted July 28, 2010 Posted July 28, 2010 Thank you, but that's not what I'm asking. If I could write the code myself I wouldn't be asking here... I'm trying to avoid asking the gods here directly for their assistance.. thanks though.. I don't know why you are angry, actually you should be more patient to be able to get more information. And I am sure that there are no gods in here, only human being are existed here. And if you don't ask for help, that means you do not also help any one that's for sure. So you don't have to thank any one if you don't want to. sweet heart. I thanking you, and would never hesitate to help you if I could. be sure. My best regards Tharwat Quote
alanjt Posted July 28, 2010 Posted July 28, 2010 And I am sure that there are no gods in here, only human being are existed here. Do you have incontrovertible proof with which to backup your statement? Quote
Tharwat Posted July 28, 2010 Posted July 28, 2010 I have no comments regarding to your question or even your statement ........ I am so happy to be a normal human being ....... Quote
alanjt Posted July 28, 2010 Posted July 28, 2010 I have no comments regarding to your question or even your statement .......Oh well, I guess not everyone loves skepticism as much as I do. I am so happy to be a normal human being ....... Normal is a relative term. :wink: Quote
lpseifert Posted July 28, 2010 Posted July 28, 2010 . Normal is a relative term. Ya beat me to it. Quote
Tharwat Posted July 28, 2010 Posted July 28, 2010 "NORMAL" specially the modest . .. . . :D That's me. Quote
ILoveMadoka Posted July 28, 2010 Author Posted July 28, 2010 (edited) I'm not angry at all. Sorry if it came across that way. I'm actually surprised I could find this code addressed when I did a search. I just know many times people have code in their arsenal and that is what I was hoping for. While your answer was helpful in it's own right I had to say that it wasn't what I was looking for or others would think it was all I needed and not respond. My problem now is that there is this long thread and I still need help in my quest! And I recognize the Lisp Dieties here and give them due honor... Edited July 28, 2010 by ILoveMadoka edit Quote
alanjt Posted July 28, 2010 Posted July 28, 2010 "NORMAL" specially the modest . .. . . :D That's me. How modest of you. Quote
alanjt Posted July 28, 2010 Posted July 28, 2010 I'm not angry at all.Sorry if it came across that way. I'm actually surprised I could find this code addressed when I did a search. I just know many times people have code in their arsenal and that is what I was hoping for. While your answer was helpful in it's own right I had to saythat it wasn't what I was looking for or others would think it was all I needed and not respond. My problem now is that there is this long thread and I still need helping me in my quest! And I recognize the Lisp Dieties here and give them due honor... Anything worth having is worth working for. A while back, I wrote one that will set the width of MText and MultiLeaders; is that what you want? Quote
Tharwat Posted July 28, 2010 Posted July 28, 2010 How modest of you. As much as you can imagine .. You must be living your life as a matter of Lisp in sequence 1+1=2 Quote
ILoveMadoka Posted July 28, 2010 Author Posted July 28, 2010 (edited) A while back, I wrote one that will set the width of MText and MultiLeaders; is that what you want? Unsure. Are multileaders handled the same as regular associative dimensions? I have a set of 19 drawings that are a hodgepodge of every possible type of dimension and text. Associative dimensions, exploded dimensions, leaders, multileaders, text, mtext. All of them at all sorts of widths (and heights). It's a friggin standardization nightmare. My job? Make it right. I wasn't trying to start anything. I was actually hoping this would be an easy one... Edited July 28, 2010 by ILoveMadoka added text Quote
ILoveMadoka Posted July 29, 2010 Author Posted July 29, 2010 Please! Please! Please! Please! PLEASE HELP!!! Quote
ILoveMadoka Posted July 29, 2010 Author Posted July 29, 2010 (edited) I am researching this adnauseum and I can say with confidence that this is far beyond the scope of my very limited lisp abilities. It looks like it involves extended entity data. Again, out of my league.. I am desperately begging here.. Edited July 29, 2010 by ILoveMadoka rev Quote
alanjt Posted July 29, 2010 Posted July 29, 2010 (defun c:WD (/ ss wd) ;; Change width of selected MText and MultiLeader objects ;; Alan J. Thompson, 11.05.09 (if (and (setq ss (ssget "_:L" '((0 . "MTEXT,MULTILEADER")))) (setq wd (initget 4) wd (cond ((getdist "\nWidth <0.0>: ")) (0.) ) ) ) (progn (vlax-for x (setq ss (vla-get-activeselectionset (cond (*AcadDoc*) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object) ) ) ) ) ) ) (vl-catch-all-apply (function vlax-put-property) (list x (cond ((eq (vla-get-objectname x) "AcDbMText") 'Width) ((eq (vla-get-objectname x) "AcDbMLeader") 'TextWidth) ) wd ) ) ) (vla-delete ss) ) ) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.