Grasshopper

algorithmic modeling for Rhino

Since there is absolutely no explanation in the "Text mask" component's help box, I've been looking for the past 30 minutes for the proper way to define suitable text masks.

I tried using "*" and "?" wildcards, but to no avail.

The only solution I found was this (yuck !) :

Views: 3791

Replies to This Discussion

hello,

is it always the case that blahblah-Ralingues # need to loose the #?

if yes i think text splitting with space would do the job.

Hi ng5 Alex,

Yes, it is the case, but since you are suggesting this workaround, do you imply that the "Replace text" does not accept masks ?

Where did you get the idea it accepts a mask?  It says that 'F' is "(Text) Fragment to replace." - "a specific text fragment":

it seems it does not

Sure would be nice to have your data to work with...?  But Grasshopper text handling features are extremely limited, unfortunately.  Did you consider using 'Match Text (TMatch)' instead of 'Replace Text (Rep)'?

Hi Joseph,

Well, text handling is not so limited since "Replace text" accepts "Patterns" (otherwise called "Masks" when talkling about paths) !

As David said in my post "Using ranges to define paths", there are some inconsistencies due to the development process.

I'm sure V2 will be much more flexible and coherent.

In the mean time, I havent found the formatting rules for "Replace text" ! 

That's someting that hopefully will be improved too : providing helpfull...help for the components.

How would you go about and perform the forementionned task with "Replace text" ?

Oliver, you must post data/code if you don't want to waste people's time.

And as noted above, 'Replace Text' does NOT accept masks, only "a specific text fragment".

wombat has a "text replace multiple" for this purpose. It does not support masks either but will at least allow you do supply a list of fragments / replacements instead of having to chain the replace component.

Thanks Andy.

Wow...Wombat... This is what comes to my mind suddenly :

Consider how much more useful 'Match Text (TMatch)' (which does accept a wildcard pattern or RegEx expression) would be if only it returned an integer instead of a boolean, like JavaScript's 'indexOf()' method, for example:

Return value: The index of the first occurrence of searchValue, or -1 if not found.

Like so many conventional programming languages going all the way back to BASIC, JavaScript has a rich set of text manipulation features: indexOf(), match(), replace(), search()

I understand and I agree with your point Joseph.

I was marveling at all those other Wombat tools that I never knew about.

:)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service