2023-09-11 02:59 PM - last edited on 2024-09-26 01:50 PM by Doreena Deng
We have our wall types all listed out like this in our composite list
- A _ Wall: MStud 6" Ins, Gyp.
In GDL, how would I strip out everything right of the "-" and then Left of the "_"
The end result needs to be " A ".
I am struggling to get the "WALL_COMPS_NAME" to work this way.
Any help would be greatly appreciated.
Solved! Go to Solution.
2023-09-12 02:54 AM - last edited on 2023-09-17 06:57 PM by Laszlo Nagy
if strstr(WALL_COMPS_NAME,"-") > 0 and strstr(WALL_COMPS_NAME,"_")>0 then
Start_num_pos = strstr(WALL_COMPS_NAME,"-") !!!!Postion in characters of first - character
End_num_pos = strstr(WALL_COMPS_NAME,"_") !!!!Postion in characters of first _ character
new_text_ = strsub(WALL_COMPS_NAME,Start_num_pos+1,End_num_pos-Start_num_pos-1) !!!!!!!!Makes new string from first character after - to character before _
endif
this works in AC18, AC22 and AC25
I hope this will help
2023-09-11 03:36 PM
Hello,
With this function …
STRSUB (string_expression, start_position, characters_number)
2023-09-11 08:34 PM
the number is the part that won't work I believe. (We have a wall tag that is set up with exactly this method, that has been brushed aside for its limitations.)
sometimes we have a wall that is wall "A" to 8' , and wall type "D" above.
- A / D _Wall: MStud 6" Ins, Gyp.
"A / D" won't show correctly if I have this scripted to read the first 2 or 3 characters. Id simply end up with "A /"
That is why I am trying to do a split to read everything between "-" & "_"
I have it working in properties & Classifications
But can't rely on calling that Unique ID for the property, because we have a few templates, so not every projects will have the same unique ID for the property that would be coded.
2023-09-11 11:27 PM
2023-09-12 02:54 AM - last edited on 2023-09-17 06:57 PM by Laszlo Nagy
if strstr(WALL_COMPS_NAME,"-") > 0 and strstr(WALL_COMPS_NAME,"_")>0 then
Start_num_pos = strstr(WALL_COMPS_NAME,"-") !!!!Postion in characters of first - character
End_num_pos = strstr(WALL_COMPS_NAME,"_") !!!!Postion in characters of first _ character
new_text_ = strsub(WALL_COMPS_NAME,Start_num_pos+1,End_num_pos-Start_num_pos-1) !!!!!!!!Makes new string from first character after - to character before _
endif
this works in AC18, AC22 and AC25
I hope this will help
2023-09-12 03:52 AM
string = Bar_Scale1
len = STRLEN (string)
iDotPos = STRSTR (string, ":")
v1 = STRSUB (string, iDotPos + 1, 6)
v2 = SPLIT (v1, "%n", vl)
That is from my scale bar object.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-09-12 08:22 PM
This is the solution we were after.
Thanks!!!!
Thank you all for your help in this matter.