Hi All,
Hoping you can help me, trying to write an expression to take part of a file name to inform an attribute, but I'm having a tad of trouble, and I'm not sure if its possible?!
What I'm trying to achieve is that "VAR" in the sample file name below can be a series of pre-defined letters that equal a drawing status, and when this is change its will update the attribute in the titleblock
Filename = ####-###-VAR
ASB = AS BUILT
INF = INFOMATION
So I assumed I could do something like this: $(if, ($(eq, val1, val2)), dotrue [, dofalse])
Where:
Val1 = ($(substr,$(getvar,dwgname),10,3))
Val2 = INF
dotrue = Infomation
dofalse = repeat simualr to excel IF equation. to include other variations
i have a feeling that $(eq, val1, val2) has to be numerical?! - is there a version that works for text? that returns a 1 or 0 that would work wit with the IF equation?
Or is there a better way of doing this?
Thanks in advance!
Solved! Go to Solution.
Solved by Paul_Gander. Go to Solution.
Hi,
thanks for your post - although I've already got that bit of code - what I'm trying to do is use an IF equation to convert a series of letter within the drwaing title to a full word, this would allow me to maintain file naming standard.
You are on the right track. Try this:
$(if,$(eq,$(upper,$(substr,$(getvar,dwgname),10,3)),INF),Information,$(if,$(eq,$(upper,$(substr,$(getvar,dwgname),10,3)),ASB),As built, ))
There is a limit to the number of variations you'll be able to add to this though.
If I'm understanding correctly you need to nest like so:
$(if,$(eq, ($(substr,$(getvar,dwgname),10,3)), INF), Information, $(if,$(eq, ($(substr,$(getvar,dwgname),10,3)), ASB), AS BUILT, XXX))
*Edit TOO SLOW 🙂
Thanks Paul,
I'd done too many brackets in my attempt - nice to know i was on the right track!
Can't find what you're looking for? Ask the community or share your knowledge.