Adds a port in the sheet.

DlxSheet.AddPort(point, length, direction, name, type, style = DlxApp.PORTSTYLE_DEFAULT, flags = DlxApp.PORTFLAGS_DEFAULTS)


Parameter Description
point A DlxPoint object with the location to insert the port.
length Specify the port length.
direction Specifies the orientation of the port. Select from the following:
name The name to assign to the port. To insert overlined characters in the text, they must be delimited with the '|' character. Ex: P1/|P2|
type The electrical characteristics of the port. The electric type is used during the compilation of the electrical schematic and the ERC. Select from the following:
DlxApp.PORTTYPE_UNDEFINED Port with function not clearly defined.
DlxApp.PORTTYPE_INPUT Input port.
DlxApp.PORTTYPE_OUTPUT Output port.
style A DlxPinStyle object with the style of the port. If the style is not specified, the appropriate style for the port type is used.
flags Specify a combination of the following values:
DlxApp.PORTFLAGS_SHOWLINE When this option is enabled, the line connecting the two characteristic points of a port is visible.
DlxApp.PORTFLAGS_UPDATETEXT Indicates whether the name should be repositioned automatically when the port is rotated.
DlxApp.PORTFLAGS_SHOWNAME Determines whether the port name is visible.
DlxApp.PORTFLAGS_VNAME Specifies the orientation of the name when the port is placed vertically.

Return Value

The newly created DlxSheetport object. Call the IsValid() method to determine if the object was created correctly.


  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 rect = new DlxRect(50,40,120,90);
      var sheet = layer.DrawSheet(rect, "ref", "value", 0);
      var port = sheet.AddPort(new DlxPoint(50,60), 15, DlxApp.PORTDIRECTION_RIGHT, "IN1", 
                                DlxApp.PORTTYPE_INPUT, "", DlxApp.PORTFLAGS_DEFAULTS);

See also