select the text objects using polyline strike-through

select the text objects using polyline strike-through

geoferoze
Participant Participant
1,271 Views
4 Replies
Message 1 of 5

select the text objects using polyline strike-through

geoferoze
Participant
Participant

I would like to select the text objects using polyline strike-through. after select the texts, copy and past on notepad/word/excel in the same order. Is it possible ? please help me any LISP.

0 Likes
1,272 Views
4 Replies
Replies (4)
Message 2 of 5

marko_ribar
Advisor
Advisor

Have you tried using SELECT - Fence option... If you want to do it thorugh LWPOLYLINE - you should extract vertices with (setq ptlist (mapcar 'cdr (vl-remove-if '(lambda ( x ) (/= (car x) 10)) (entget lw)))) ; lw-LWPOLYLINE ename; and then pass that list of points through (ssget "_F" ptlist '((0 . "TEXT"))) to get selection set with TEXT entities... Then you should iterate through that sel. set and obtain each text string (setq str (cdr (assoc 1 (entget txt)))) ; txt-TEXT ename... After you collect each text string and construct coresponding list of strings you should iterate thorugh that list and write each string using (write-line str file) ; str- string in double quotes; file- opened file variable - you open it for writing by (setq file (open "c:\\some folder\\some file.txt" "w")) - "w" - writing... After you process each string you finally close opened file variable with (close file)...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 5

Kent1Cooper
Consultant
Consultant

@geoferoze wrote:

I would like to select the text objects using polyline strike-through. after select the texts, copy and past on notepad/word/excel in the same order. ….


 

You don't say what you want to then do with the pasted-in-same-order result.  If, by chance, you want to then paste that resulting combination back into the drawing in an Mtext object, you can use OneMtext.lsp, available >here<.   One of its differences from the TXT2MTXT command is that the order of selection determines the order of the joined-together result, rather than the relative positions of the selected objects.  No need for a Polyline strike-through object to define the order -- just pick them in the order you want.  See the description at the top of the file for the choices about what it puts between the contents of the selected objects.

 

If you want to do something entirely different with the result, outside AutoCAD, you could use one of OneMtext's commands to combine things in the order you want, and then open that result in the Mtext editor and Copy its content out to Paste into whatever program you like.  Then Undo back to where the original pieces return to their places.

Kent Cooper, AIA
0 Likes
Message 4 of 5

geoferoze
Participant
Participant

@Kent1Cooper wrote:

@geoferoze wrote:

I would like to select the text objects using polyline strike-through. after select the texts, copy and past on notepad/word/excel in the same order. ….


 

You don't say what you want to then do with the pasted-in-same-order result.  If, by chance, you want to then paste that resulting combination back into the drawing in an Mtext object, you can use OneMtext.lsp, available >here<.   One of its differences from the TXT2MTXT command is that the order of selection determines the order of the joined-together result, rather than the relative positions of the selected objects.  No need for a Polyline strike-through object to define the order -- just pick them in the order you want.  See the description at the top of the file for the choices about what it puts between the contents of the selected objects.

 

If you want to do something entirely different with the result, outside AutoCAD, you could use one of OneMtext's commands to combine things in the order you want, and then open that result in the Mtext editor and Copy its content out to Paste into whatever program you like.  Then Undo back to where the original pieces return to their places.


Many thanks for your response!

OneMtext.lsp is working good. Actually the picking of text in order means one by one is time consuming. In this application,  is there any way to pick the text by dragging line over the text? 

By

Feroze Khan  

0 Likes
Message 5 of 5

Kent1Cooper
Consultant
Consultant

@geoferoze wrote:

….

OneMtext.lsp is working good. Actually the picking of text in order means one by one is time consuming. In this application,  is there any way to pick the text by dragging line over the text?


 

Try the attached OneMtextF.lsp -- the F is for Fence, because of your specific request, but it's not limited to that.  See comments at the top of the file for how the order in the result is determined.  It lets you pick one at a time as with the original routine, but also allows any and all  selection option(s), including your requested Fence selection [which you must ask for as an option in the object-selection process].  The nature of returned order with Fence selection requires the reversing that causes it to use reverse drawing order with other selections [such as by Window/Crossing]; I suppose it could be altered to use positional relationship, as TXT2MTXT does, but that wouldn't require a custom routine unless you need it to take both Text and Mtext originals [which TXT2MTXT doesn't].

Kent Cooper, AIA