Jump to content

Lisp To Extract Particular Type of text into excel.


hasanahtesham

Recommended Posts

let say my Autocad Drawing has Many text in it,for example "TG,PG,NHP01-0035,CCW-125-hb1-55H, NGT-127-HB2-50P"

 

 

i want to extract only CCW-125-HB1-55H or NGT-127-HB2-50P type of text.

 

any lisp for that??...help me please.

Link to comment
Share on other sites

please define the type of text you would like to extract a bit clearer.

Do you mean you want only the two strings

"CCW-125-HB1-55H" // "NGT-127-HB2-50P"

 

or do you mean that you want to pick DTEXT (single line, not-mtext, not-attribute text) with 3 characters, hyphen, 3 characters, hyphen, 3 more, -, last 3 characters?

Or did you mean that you want all number and letter combinations of MTEXT only, and even those that ARE ATTRIBUTES?

 

 

These are only a few examples of the possible combinations of text entities that match what you've provided and the more-specific answer would be vital I think to any program written to help you

Link to comment
Share on other sites

It could be as simple as

(setq search (strcat (getstring "\nEnter first few characters") "*" )) 
(setq ss (ssget (list (cons 0 "Text")(cons 1 search))))
(alert (strcat "you have picked " (rtos (sslength ss) 2 0) "Text objects") )
; now export to excel

 

Like Bhull1985 need more info

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

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