Is there a way of checking what a name starts with?
Instead of:
- Code: Select all
if e.definition.name == "MyComp"
I need something like:
- Code: Select all
if e.definition.name STARTS WITH? "MyComp" (Pseudo code)
Is that possible?
How do I check if component name starts with a certain word?
4 posts
• Page 1 of 1
How do I check if component name starts with a certain word?I noticed a bug in one of my scripts because there can be multiple components created with names like MyComp, MyComp#1, MyComp#2 and so on.
Is there a way of checking what a name starts with? Instead of:
I need something like:
Is that possible? Re: How do I check if component name starts with a certain wThis seem to work:
Re: How do I check if component name starts with a certain wAnother way of phrasing it is:
To pass a 'variable' instead of a string of characters, use
TIG
Re: How do I check if component name starts with a certain w.
Ruby 2.x+ (SketchUp 2014+) String#start_with? ie ...
... or ...
4 posts
• Page 1 of 1
|