Diesel Expression that reads the Layout tab?!

Diesel Expression that reads the Layout tab?!

FeeopEngr
Advocate Advocate
599 Views
3 Replies
Message 1 of 4

Diesel Expression that reads the Layout tab?!

FeeopEngr
Advocate
Advocate

I need a little help as I know very little about diesel, other than it can do what i want.

 

Starting with the string below, I need 2 expressions.

 

$(upper,$(getvar,ctab),$(-,$(strlen,$(getvar,ctab)),1),5)

 

One that gives me the last 5 characters of CTAB, which I think this one will and

 

One which gives me the first 3 characters of CTAB

 

My Sheet Tabs will all look like this "A-A S2.01" no quotes and a space between the 2 texts.

 

Thanks for the help

 

Feeop
0 Likes
600 Views
3 Replies
Replies (3)
Message 2 of 4

hmsilva
Mentor
Mentor

@jshorttiller wrote:

I need a little help as I know very little about diesel, other than it can do what i want.

Starting with the string below, I need 2 expressions.

$(upper,$(getvar,ctab),$(-,$(strlen,$(getvar,ctab)),1),5)

 

One that gives me the last 5 characters of CTAB, which I think this one will and

 

One which gives me the first 3 characters of CTAB


Hi jshorttiller,

to get the last 5 characters of CTAB (in uppercase?)

$(upper,$(substr,$(getvar,ctab),$(-,$(strlen,$(getvar,ctab)​),5),5))

to get the first 3 characters of CTAB (in uppercase?)

$(upper,$(substr,$(getvar,ctab),1,3))

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 4

FeeopEngr
Advocate
Advocate

Thanks HMSILVA

 

Almost perfect.

 

For the expression to get the last 5 characters, is it possible to strip off the leading space so only 4 characters show up if the tab looks like S2.0 instead of S2.01

Feeop
0 Likes
Message 4 of 4

hmsilva
Mentor
Mentor

@jshorttiller wrote:

Thanks HMSILVA

 

Almost perfect.

 

For the expression to get the last 5 characters, is it possible to strip off the leading space so only 4 characters show up if the tab looks like S2.0 instead of S2.01


You're welcome,
I think it will not be possible, DIESEL Functions, are very limited...

Using Auto/Visual LISP, It would be quite easy...

 

ADIT: try the the following string

$(if,$(<,$(strlen,$(getvar,ctab)),9),$(upper,$(substr,$(getvar,ctab),$(-,$(strlen,$(getvar,ctab)),3),4)),$(upper,$(substr,$(getvar,ctab),$(-,$(strlen,$(getvar,ctab)),4),5)))



Henrique

 

EESignature

0 Likes