News:

All posts discussing pricing or where to buy TurboCAD will be deleted.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

How to select just numbers within Text

Started by lakkabay, January 20, 2017, 07:59:56 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

lakkabay

Hi. Does anyone know if its possible to select specific items within text? I have a text layer on a map that contains street names and also the house numbers (it's a big map and therefore there are 100's of them) and I'm trying to select then delete the numbers only while leaving the text alone. I've had a look at Edit / Select By and had a go at using Query but can't find a way to do it. Clicking on every number and deleting them that way could be incredibly dull! Cheers.

Henry Hubich

That's an interesting problem, and I'd be surprised if there is a way to do it entirely within TCad. If you think this problem might arise again, you can make it easier the next time around by using a very slightly different Pen color for the numbers. You probably won't be able to see the difference, but you'll be able to select them for deletion using Select by Color.

Henry H

lakkabay

Yep, that's a good idea. The slight (other) problem I have is that the particular layer is called 'Building Names and Numbers' contains quite a few names I need to keep. I haven't created this plan - it was given to me so that I can use it as a base onto which I'm going to draw a layout for an event.

Henry Hubich

Quote from: lakkabay on January 20, 2017, 08:37:57 AM
Yep, that's a good idea. The slight (other) problem I have is that the particular layer is called 'Building Names and Numbers' contains quite a few names I need to keep. I haven't created this plan - it was given to me so that I can use it as a base onto which I'm going to draw a layout for an event.

Don't forget that one way to edit a selected Text object is via the "General" page in its Properties dialog. You can insert spaces as placeholders if you wish.

Henry H

murray dickinson

In select by attributes, there's a text entities category, and 'by string' too.  Might be some way of isolating number strings with those.

lakkabay


Henry Hubich

Quote from: murray dickinson on January 20, 2017, 12:22:26 PM
In select by attributes, there's a text entities category, and 'by string' too.  Might be some way of isolating number strings with those.

My reading of the Help file seems to indicate that this is a viable approach, but I have NOT been able to make it work.

Henry H

murray dickinson

#7
I found that selection by attribute works, provided the objects are definitely text objects.  For example, I put a number of strings in the drawing that were street names and numbers, eg 15 grosvenor, 24 grosvenor, 30 grosvenor.  They were selected discriminately when the string was termed with wildcards and street name, ***grosvenor, or specific numbers and wildcards, like 15********** and so on.  Going to properties and entering just the street name took the numbers from the strings, leaving the street name only.  Henry's note above about placeholders would leave room for future editing.

*edit* a little further research showed that they don't have to be specified as "text entities only", only "by string", although I assume that exploded shx geometry would be dumbed down too much for it to work.

Andy H

I guess it depends really on whether the numbers are actually contained in the street text, on some street plans we used to have at work most numbers were a separate entity. 

If this was a regular occurrence, another option would be to modify a macro or write a script, but this would probably be too much hassle if it was just a one off job.

murray dickinson

#9
If the numbers are separate entities, then a list of numbers as strings in attribute selection, 29 arrangements 1**  to  9**, *1* to *0*,  **1 to **0 ranges 1 to 999, I think.

Dean

#10
You can query (to select) an Attribute's "Tag" and "value",as long as they're not nested in a block.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

murray dickinson

What do those terms mean, Dean?  I tried that, assuming that "value" means numerical value, and query happily chirped that it parses successfully, but it didn't select the numbers.  I have no idea of what a "tag" is in this context. 

Dean

Quote from: murray dickinson on January 22, 2017, 03:13:02 PM
What do those terms mean, Dean?  I tried that, assuming that "value" means numerical value, and query happily chirped that it parses successfully, but it didn't select the numbers.  I have no idea of what a "tag" is in this context.

Murray,
Attributes contain tag,prompt and value. You can query the tag and value.
I always use "active" attributes so they can easily be extracted or selected.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

murray dickinson

How do you find out what they are, to query them?! 

Dean

Quote from: murray dickinson on January 22, 2017, 03:31:16 PM
How do you find out what they are, to query them?!

Well, if the drawing doesn't contain any type of reference and you don't have a clue what the attributes tags or values are you  can always extract the data from blocks and or use the database tools.
You can always post a file, Murray
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

murray dickinson

I'm still learning, Dean, like you!  I don't have an example or even a specific file in mind, but I'd like to know if there are other attributes beyond the obvious ones that'd make discrimination easier.   I'm intrigued by the logic involved in isolating entities in drawings that haven't been set up to facilitate discrimination from the get-go, or that are in neutral formats without proprietary smart features.

lakkabay

Quote from: murray dickinson on January 22, 2017, 11:17:24 AM
If the numbers are separate entities, then a list of numbers as strings in attribute selection, 29 arrangements 1**  to  9**, *1* to *0*,  **1 to **0 ranges 1 to 999, I think.

Hi Murray, I'm kinda new to this string thing but I managed to do what you suggested and cleared out the number only text. However the plan is a combination of 2 separate plans joined together to make 1 larger one  (I imported one into the other) and the text on the 2nd plan is Multiline Text. Now I can't seem to find a way of selecting the numbers only. If there was a way of changing the Multline Text to normal Text then I'd have no problem but I'm unsure about how to do that!

murray dickinson

#17
AutoCAD's original .shx fonts were meant to remain human-readable even though they'd been dumbed down and no longer text, and I think that's what you're referring to.  I don't know of any way to deal with that, because the geometry isn't text anymore, so it can't be interpreted as strings.   Beyond my expertise now, unless you can get a copy of the multiline text file which hasn't had the text exploded? 

Does the file distinguish the multilines as "multiline text", or is that your description?

Dean

Quote from: murray dickinson on January 22, 2017, 05:19:13 PM
I'm still learning, Dean, like you!  I don't have an example or even a specific file in mind, but I'd like to know if there are other attributes beyond the obvious ones that'd make discrimination easier.   I'm intrigued by the logic involved in isolating entities in drawings that haven't been set up to facilitate discrimination from the get-go, or that are in neutral formats without proprietary smart features.
Murray,
A "for instance" of your isolated entities would be helpful.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

murray dickinson

I think the OP has discovered them, Dean.  When we exchange solid and surface files with .step or .iges, we lose the part tree, so the parts are dumb solids.  Exchanging files with dimensions or text via .dwg can keep text as text, but if files are exchanged with .dxf or inadvertantly exploded, text is downgraded to polylines or multilines, so dims lose associations, text loses its meaning, it becomes dumb geometry.  OCR is one way of recovering meaning from polyline text, but most OCR programs aren't much good unless text is orthogonal, so it's much less successful with angled dims and text.  So I'm thinking about attributes that might be exposed even if the text has been exploded/downgraded, and when you referred to tags and values, I wondered what they are and how they might be used to do that. IMSI supplied a Corel Trace program with TC V7 and V8, it could do OCR with the trace results, around 85%-90% successfully in my trials, which sounds quite good but still leaves more work correcting than you realise.  That rate fell right off when the text was angled.