Specifies the dimension text. Leave this field blank to use the format specified in the style or directly specify the format.

syntaxSyntax:
DlxDimension.SetTextFormat(format)

Parameters

Parameter Description
format A string with the format of the dimension text.

Return Value

If the operation ends correctly, it returns true otherwise it returns false.

Remarks

The format string consists of zero or more directives and common characters. A directive is formed by the character '@' followed by a character that determines the substitution that must take place. All common characters are copied unchanged. The directives are as follows:

@V

Specifies the location where the dimension value is to be inserted.

@U

Specifies the location where the unit of measure is to be inserted.

@T

Specifies the position at which tolerance values are to be inserted.

@F

Specifies the position at which the frequency values are to be entered. This directive is used when dimension is used in diagrams. It converts the values of the time axis into frequency values and adds them to the dimension text.

Example:
If the value of the dimension is 10 and the unit of measurement is in millimetres, the following format strings will produce the following text string:
R.@V -> R.10
@V@U -> 10mm

Example

  Copy codeCopy code
var prj = DlxApp.GetJob().GetProject("Example Sch");
if (!prj.IsValid())
  prj = DlxApp.GetJob().NewProject("Example Sch");
var doc = prj.GetDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
if (!doc.IsValid())
{
  doc = prj.NewDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
  doc.SetPageFormat("A4", false);
}
if (doc.IsValid() && doc.Activate())
{
  var page = doc.GetActivePage();
  if (page.IsValid())
  {
    var layer = page.GetLayerFromType(DlxApp.LAYERTYPE_DRAWING);
    if (layer.IsValid())
    {
      var p1 = new DlxPoint(50, 50);
      var p2 = new DlxPoint(100, 100);
      layer.DrawLine(p1, p2);
      var obj = layer.DrawAlignedDimension(p1, p2, 10);

      if (obj.GetTextFormat().length == 0)
      {
        obj.SetTextFormat("Length=@V@U");
      }
    }
  }
}

See also