• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

extract text contained in a block

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I wrote this short code that extracts the text from a string present in the drawing:
Code:
    (defun c:copiatesto (/ txt1 fp1)

        (setq ed1 nil)

        (while (= ed1 nil)
            (setq ed1 (entsel "\nseleziona un testo"))
        );;while

        (setq ed1 (entget (car ed1)))
    (setq txt1 (cdr (assoc 1 ed1)))

        (princ "\n")
        (princ "txt1 >>>>> ")
        (princ txt1)
        (princ "\n")
    );;defun
I would like that, in addition to a single line of text, the program can also extract a text contained in a block.
I tried to select a multiriga text block, but only one part is copied.
Dudes.
 
instead of using entsel, try with nentsel, you return the name of the selected entity, in the specific case, not the block but directly the text.
 
thanks rpor66 but also with > nentsel < the result is identical or a part of the text block is returned.
I must point out that this block has been made using a copy and paste from the note block ( .txt file).
I tried with a multiriga text and the individual rows are returned separately with a > < < .
 
all multiriga return separate rows from \, just search for \\ character and replace it with a space
 
ok rpor66 already done! how do I set the selection to "elastic" with the lisp?
 
nentsel is only a single selection, cannot know which sub entity to process, artificial intelligence is not present in autocad?.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top