aniketpatade Posted May 26, 2016 Posted May 26, 2016 "XX" should be replaced by "AH9" when mouse cursor clicks device "AH" and its contact 9.MULTIPLE TEXT SHOULD BE COMBINE TO SINGLE TEXT. Please if you have this kind autolisp program or tool kindly provide it will save lot of time. EXAMPLE.dwg Quote
Dadgad Posted May 26, 2016 Posted May 26, 2016 Welcome to CADTutor Forum. Try the following lisp by the master, Lee Mac. It is just one of a good many lisps which Lee, very generously, makes available to the global CAD community, on his incredible website. He has lots more for working with Text on his site. http://www.lee-mac.com/text2mtext.html Thanks Lee! Quote
aniketpatade Posted May 26, 2016 Author Posted May 26, 2016 hello Dadgad, I tried this but it doesn't combine 2 text into 1, this tool keeps 2 text besides each other or below or above and if the property of text is different it shows an error. for example "AA" will show as "%ª" Quote
Dadgad Posted May 26, 2016 Posted May 26, 2016 I was pretty sure Lee had one which would do this, sorry it didn't do what you needed. He has lots of others, which I just looked through, one of them will Match Text Attributes, but I didn't see one that does exactly what you need. Quote
tombu Posted May 26, 2016 Posted May 26, 2016 (edited) Try: (setq thisdrawing (vla-get-activedocument (vlax-get-acad-object)) ssSelections (ssget (list (cons 0 "TEXT,MTEXT"))) intCount 0 ;Start with first selection. ) (if(ssmemb entSelection ssSelections)(ssdel entSelection ssSelections)) ; Don't delete First selection if selected again. (repeat (sslength ssSelections) (vla-startundomark thisdrawing) (setq entSelection (ssname ssSelections intCOunt) objSelection (vlax-ename->vla-object entSelection) intCount (1+ intCount) ;increment to next selection. ) (if(= btwtxt " ") (while(vl-string-search "\\P" (vla-get-textstring objSelection)) (vla-put-textstring objSelection (vl-string-subst " " "\\P" (vla-get-textstring objSelection)) ) ) ) (vla-put-textstring objSelection1 (strcat (vla-get-textstring objSelection1) ; btwtxt ; Space for text or new line for mtext (vla-get-textstring objSelection) ) ) ; (vla-delete objSelection) ; Delete added text object (vla-endundomark thisdrawing) ) (princ) ) Edited May 27, 2016 by tombu Remarked out code for adding space and deleting added text objects. Quote
aniketpatade Posted May 27, 2016 Author Posted May 27, 2016 thanks a ton tombu, The above program takes me to next level but it has some issues, if this issue will be solved than nothing best can happen. Anyways thanks for the program. PFA for issues in Magenta and Green Color. Thanks & Regards, Aniket EXAMPLE2.dwg Quote
tombu Posted May 27, 2016 Posted May 27, 2016 thanks a ton tombu,The above program takes me to next level but it has some issues, if this issue will be solved than nothing best can happen. Anyways thanks for the program. PFA for issues in Magenta and Green Color. Thanks & Regards, Aniket I modified the code in my previous post, see if it works for you now. I'm a Land Surveyor who does Civil work mostly, sorry don't have a clue what you're doing in that drawing. Quote
aniketpatade Posted May 30, 2016 Author Posted May 30, 2016 thanks tombu, It worked!!! :-D the above program solved my problem. thanks again. 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.