Gets the format string for the dimension line text.
Syntax: |
---|
DlxDimension.GetTextFormat() |
Return Value
Returns the format string for the text.
Example
Copy 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");
}
}
}
}
|