Hello,
I was wondering if someone might be able to help me figure out a small diesel script for pulling some characters from files names of drawings
eg,
i have dwg files with a naming scheme that looks like this.
01-C0-01.dwg
02-C0-02.dwg
03-C1-01.dwg
04A-C1-02.dwg <---
04B-C1-03.dwg <---
etc
i would like the script to display the first 2 characters of the file name which i have below.
$(substr,$(getvar,dwgname),1, 2)
but also display the 3rd (A or B or C) character in the file name only if the 3rd character is not a - (hyphen)
i guess my first question is this possible? becuase i have been trying with no luck and with limited knowledge of diesel scripts etc.
Thank you very much
Solved! Go to Solution.
Solved by doni49. Go to Solution.
Here's a link to the if function in the Deisel help.
Don Ireland
Engineering Design Technician
hi again
thank you i have been toying around with that function for a while now and cant seem to make it work not sure how to implement it into the ex script i have
thanks again for any help you can give
$(if,$(eq,$(substr,$(getvar,"dwgname"),3,1),"-"),$(substr,$(getvar,"dwgname"),1,2),$(substr,$(getvar,"dwgname"),1,3))
Edit: I had the false and true conditions backwards -- if the third character was a hypen, then it showed it. It's switched.
Don Ireland
Engineering Design Technician
Happy to be of assistance.
Don Ireland
Engineering Design Technician