New CADforum look launched.
Over 1.085.000 registered users (EN+CZ). Try the new Engineering calculator, the CAD conversion wizard, the Color converter and USD viewer. Learn about twiGIS.
Over 1.085.000 registered users (EN+CZ). Try the new Engineering calculator, the CAD conversion wizard, the Color converter and USD viewer. Learn about twiGIS.
CAD tip # 7003:
Question
A
If you want to insert a text in your drawing (e.g. to the title block) which contains a manipulated name of the current drawing file - e.g. the filename left-trimmed or right-trimmed at a number of characters, you can use a combination of Diesel expressions in an automatic text field (e.g. with the FIELD command).
Some examples:
Drawing file name, no path, from the 3rd character (paste as a Diesel expression to a Diesel-type field):
$(substr,$(getvar,DWGNAME),3,99)Drawing file name, no path, no extension (4 characters), right-trimmed at another 3 characters (paste as a Diesel expression to a Diesel-type field):
$(substr,$(getvar,DWGNAME),1,$(-,$(strlen,$(getvar,DWGNAME)),7))Beginning of the drawing path (12 characters), ellipsis, first 8 characters of the drawing file name (paste as a Diesel expression to a Diesel-type field):
$(substr,$(getvar,DWGPREFIX),1,12)...$(substr,$(getvar,DWGNAME),1,8)Path without the disk letter and the drawing file name, all converted to uppercase (paste as a Diesel expression to a Diesel-type field):
$(upper,$(substr,$(getvar,DWGPREFIX),3)$(getvar,DWGNAME))
ACADACLTADT
![100%](../common/cf1.gif)
![](../common/cf0.gif)
19.10.2009
34248×