AddLine Method (Block Object)

Scope: Schematic editor

Object: Block Object

Prerequisites: None

Adds a line to the block.

Usage

Block.AddLine(ByVal Pt1 As Long, ByVal Pt2 As Long) As IVdLine

Arguments

Pt1

Starting coordinates (packed) of the line.

Pt2

Ending coordinates (packed) of the line.

Return Values

As IVdLine. The newly created Line Object.

Description

The two points passed in are packed into two longs, with low word representing the X coordinate and the high word representing the Y coordinate. For example:

MAKELONG(X,Y)

The X,Y coordinates are packed into a single long, in accordance with the C++ MAKELONG macro.

Examples

For Visual Basic, implement this function as follows:

Function LOWORD(ByVal dw)
 If dw And &H8000& Then
 LOWORD = dw Or &HFFFF0000
 Else
 LOWORD = dw And &HFFFF&
 End If
End Function

Public Function MAKELONG(LoByte, HiByte)
 If HiByte And &H80 Then
 MAKELONG = ((HiByte * &H100&) Or LoByte) Or &HFFFF0000
 Else
 MAKELONG = (HiByte * &H100) Or LoByte
 End If
End Function