Via Object Methods

ClearLayerMapping(fp_layer)

Clears the mapping between a footprint layer and a layer in the padstack definition.

Parameters:

fp_layer: An integer id retrieved from GetLayerID

Example:

var v1 = LayoutHost.NewVia("via1", layer, bottom, 0, 0, "Round 1mm/0.5mm", 0.2);

v1.ClearLayerMapping(layer);

ClearLayerMappings

Clears the mapping between all footprint and padstack definition layers.

Example:

var v1 = LayoutHost.NewVia("via1", layer, bottom, 0, 0, "Round 1mm/0.5mm", 0.2);

v1.ClearLayerMappings();

Copy()

Create and return a copy of the via.

Example:

var via_copy = via.Copy();

DefaultLayerMapping

Reset the mapping between all footprint and padstack definition layers to the default mapping.

Example:

var v1 = LayoutHost.NewVia("via1", layer, bottom, 0, 0, "Round 1mm/0.5mm", 0.2);

v1.DefaultLayerMapping();

MirrorX(x)

Mirrors the via position about the specified X value (Y value is unchanged; an X value falling on this line is unchanged).

Parameters:

X: Center of reflection (X values on this line are unchanged).

Example:

via.MirrorX(0);

MirrorY(y)

Mirrors the via position about the specified Y value (X values are unchanged; a Y value falling on this line is unchanged).

Parameters:

Y: Center of reflection (Y values on this line are unchanged).

Example:

via.MirrorY(0);

MoveBy(dx, dy)

Translates the via by the specified offset.

Parameters:

Dx: X offset

Dy: Y offset

Example:

via.MoveBy(10, 20);

MoveTo(x, y)

Moves the via to the specified location; useful for rectangles, circles and arcs (the center point is moved)

Parameters:

X: New X location

Y: New Y location

Example:

via.MoveTo(10, 20);

Rotate(x, y, angle)

Rotates the via counter-clockwise about the specified location by the angle specified (in radians).

Parameters:

X: X center

Y: Y center

Angle: Rotation angle in radians

Example:

via.Rotate(0, 0, Math.PI/4);

Scale(x, y, factor)

Scales the via position about the specified location by the factor specified.

Parameters:

X: X center

Y: Y center

Factor: Scale factor (2 implies 2 times, 4.5 implies 4 and a half times, etc.)

Example:

via.Scale(0, 0, 2);

SetLayers(start_layer, end_layer)

Sets the via layer range

Parameters:

Start_layer: An integer id retrieved from GetLayerID

End_layer: An integer id retrieved from GetLayerID

Example:

var top = LayoutHost.GetLayerId(“top”);

var bottom = LayoutHost.GetLayerId(“bottom”);

via.SetLayers(top, bottom);

SetLayerMapping(fp_layer, ps_layer, pad_type);

Creates or adjusts the mapping between a footprint layer and the padstack definition layer.

Parameters:

fp_layer: An integer id retrieved from GetLayerID

ps_layer: The name of the layer in the padstack definition

pad_type: Unused

Example:

var v1 = LayoutHost.NewVia("via1", layer, bottom, 0, 0, "Round 1mm/0.5mm", 0.2);

v1.ClearLayerMappings();

v1.SetLayerMapping(layer, "template", "");

v1.SetLayerMapping(bottom, "template", "");