Hi All,
I have a problem that I'd like some help on if I can.
We are using a title block and it has an attribute field that links to the file name. Now one of our projects is adding the revision to the CAD file name, but it messes up our drawing sheets.
i.e. It was fine when the CAD file name was 111-A222-ZZ-X-123456.dwg and this would display the complete 111-A222-ZZ-X-123456 in the drawing title.
Now we need to do this, the CAD file name, 111-A222-ZZ-X-123456-001002-A1.dwg and we still need to just show 111-A222-ZZ-X-123456 in the title block, striping away the 001002-A1.
Is this possible? It would make my life so simple if it can be done.
Thanks
Tim D
You could use a DIESEL expression to remove a specific number of characters from the end of the string, something like:
$(substr,$(getvar,DWGNAME),1,$(-,$(strlen,$(getvar,DWGNAME)),14))
Here I am removing the four characters: ".dwg" and the 10 characters "-001002-A1"
Hi Lee,
I thought you could do this with Diesel too but I messed with it for awhile and can't get the diesel to work within the field... shouldn't somethign like:
%<\$(substr,$(getvar,DWGNAME),1,$(-,$(strlen,$(getvar,DWGNAME)),4))>%
work if you paste it into mtext editor???
Mine returns "####" as a field.
Probably the something to do with the %$<\ characters yah?
@Shneuph wrote:%<\$(substr,$(getvar,DWGNAME),1,$(-,$(strlen,$(getvar,DWGNAME)),4))>%
Probably the something to do with the %$<\ characters yah?
got it...
%<$(substr,$(getvar,DWGNAME),1,$(-,$(strlen,$(getvar,DWGNAME)),4))>%
worked...
Or:
%<\\AcDiesel $(substr,$(getvar,DWGNAME),1,$(-,$(strlen,$(getvar,DWGNAME)),4))>%
But if you just want the filename, its easier to use:
%<\\AcVar Filename \\f \"%fn2\">%
@Anonymous wrote:
Is it possible to use any part of the dwg file name in files using those codes. What it I wanted to havecanother field and just show the A1 in that one?
Yes, but note that the solutions provided are obtaining a substring with a known number of characters - hence the field in my first post will always trim 14 characters, whatever the filename.
@Anonymous wrote:
Also, are there any good books on this?
For DIESEL, I mostly use this reference.
Good Morning All,
Back onto this subjuct today. I've ran into a problem with what we did in these drawing sheets using the CAD file name as above.
Sometimes the revision on these drawings goes from A1, A2, A3, then back down to A ro be released to another contractor that just has alpha codes foer their revision status.
This cause the autofields do display the wrong drawing number, sheet number and total number of sheets.
I have redone those to just use this expression to cut off the length of string
$(substr,$(getvar,DWGNAME),1, 20)
etc,
But the problem I am now having is how to define the length to the revision in the files name and to substract the ".dwg" off the end i was hoping this would do it
$(substr,$(getvar,DWGNAME),29, 2,$(-,$(strlen,$(getvar,DWGNAME)),31))
But this doesnt work.
For reference the drawing files names are like this
421-F100-DF-Y-00GF10-001020-A1.dwg
421-F100-DF-Y-00GF10-001020-A2.dwg
421-F100-DF-Y-00GF10-001020-A3.dwg
421-F100-DF-Y-00GF10-001020-B.dwg
Any help would be greatly recieved.
Thanks.
Tim