Gets the coordinates of a vertex of the OLE frame.

syntaxSyntax:
DlxOLE.GetCornerPoint(index)

Parameters

Parameter Description
index Specify the corner index. Specify one of the following values:
DlxApp.CORNERINDEX_BOTTOMLEFT
DlxApp.CORNERINDEX_BOTTOMRIGHT
DlxApp.CORNERINDEX_TOPRIGHT
DlxApp.CORNERINDEX_TOPLEFT

Return Value

If the operation is successful, it returns a DlxPoint with the coordinates; otherwise it returns an invalid point. Use IsValid to verify that the point is valid.

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 pos = layer.GetFrontObjectIterator();
      while (pos.IsValid())
      {
        var obj = layer.GetNextObject(pos);
        if (obj.GetType() == DlxApp.OBJTYPE_OLE)
        {
          var dlg = new DlxDialog(400, 160, "Image Size");
          if (dlg.IsValid())
          {
            dlg.AddStaticText(10, 33, 70, "Vertical: ");
            dlg.AddStaticText(10, 58, 70, "Horizontal: ");
            var ctrl_h = dlg.AddEditNumber(90, 30, 300, DlxApp.DIALOGEDITNUMBER_LENGTH, obj.GetHeight(), 0, 30);
            var ctrl_w = dlg.AddEditNumber(90, 55, 300, DlxApp.DIALOGEDITNUMBER_LENGTH, obj.GetWidth(), 0, 30);
            dlg.AddOkButton(280, 120, 50, 25);
            dlg.AddCancelButton(340, 120, 50, 25);
            if (dlg.DoModal())
            {
              obj.SetFrame(obj.GetCornerPoint(DlxApp.CORNERINDEX_BOTTOMLEFT), ctrl_w.GetNumber(), ctrl_h.GetNumber());
            }
          }
        }
      }
    }
  }
}

See also