Jump to content

Recommended Posts

Posted

"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

Posted

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! :beer:

Posted

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 "%ª"

 

 

 

 

Posted

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. :|

Posted (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 by tombu
Remarked out code for adding space and deleting added text objects.
Posted

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

Posted
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.

Posted

thanks tombu,

 

 

It worked!!! :-D the above program solved my problem. thanks again.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...