bdeCreatePort

Creates a new port for a given block.

Syntax

newPort = bdeCreatePort(block, varType, ioType, portType, portSide, shape)

Inputs

block
The block to create a new block for.
Type: block
varType
The variable type of the port. Has options of either variableport or fixedport. Variable port allows for multiple ports on a given side of a block. Fixed port means the block can only have one input and output port.
Type: string
ioType
The input/output type of the port. Options are input or output.
Type: string/hwdc::IOType
portType
The type of the port. Options are activation, explicit, implicit, and bus.
Type: string
portSide
The side that the port will be placed on the block. Options are left, right, top, bottom. Can also use an argument of the type hwdc::Position.
Type: string/hwdc::Position
shape
The shape to set for the port. Options are triangle, rectangle, and ellipse.
Type: string/hwdc::GraphicsType

Outputs

newPort
The newly created port.
Type: hwdcConnectionPoint

Examples

Create a new port:

          diagram = bdeGetCurrentDiagram();
          block = bdeGetSelectedBlock(diagram);
          newPort = bdeCreatePort(block, 'fixedport', 'input', 'explicit', 'left', 'triangle')
        

          
            newPort = hwdcConnectionPoint