Over 1.109.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
Try the updated Units converter and the new precise Engineering calculator.
New AutoCAD 2026 commands and sys.variables and env.variables,.
CAD tip # 10239:
Question
A
With a simple DIESEL expression you can created conditional text fields, i.e. AutoCAD drawing texts which change their contents on particular external conditions.
As an example, you can have a dynamic text (e.g. a title block attribute), which displays different contact information depending on the login name of the current user.
The the text field (FIELD) or in a plain Text, enter the following expression (on a single line):
%<\AcDiesel $(if,$(eq,$(getvar,loginname),"Jeff"),"jeff[at]cadstudio.cz",$(if,$(eq,$(getvar,loginname),"John"),"john[at]cadstudio.cz",$(if,$(eq,$(getvar,loginname),"Mary"),"mary[at]cadstudio.cz","cannot detect e-mail address")))>%
Due to the length limit of DIESEL expressions you can also write the tests individually - e.g.:
$(if,$(eq,$(getvar,loginname),"John"),"tel. 123456-987") $(if,$(eq,$(getvar,loginname),"Bob"),"tel. 123456-986") $(if,$(eq,$(getvar,loginname),"Jenny"),"tel. 123456-985") $(if,$(eq,$(getvar,loginname),"Stephanie"),"tel. 123456-984") ...
In AutoCAD LT you can use a similar environment variable - USERNAME - $(getenv,username).
ACADACLT
15.3.2015
20828×
this tip shared by ARKANCE experts applies to: AutoCAD · AutoCAD LT ·
![CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]](../common/arkance_186.png)

