title: Autocad Diesel IF expression for sheet number tag
body: <p>I am trying to automate a sheet tag with a Diesel expression in AutoCad. </p>
  
  <p>This gets me the twelfth character in the drawing name. But as soon as I get to sheet 10 this will say its sheet 0.</p>
  
  <p><code>$(substr,$(getvar,dwgname),12,1)</code></p>
  
  <p>Does anyone know a way to get an If statement to see if the eleventh character is a 0 then run the above code else run <code>$(substr,$(getvar,dwgname),11,2)</code></p>
  
  <p>This is something i have tried.
  <code>$(IF,substr,$(getvar,dwgname),11,1)="0"$(substr,$(getvar,dwgname),11,2,substr,$(getvar,dwgname),12,1)</code></p>
  
  <p>This appears to be similar to excel formulas. Thanks for any help.</p>