CAM Library
API Reference
Get Functions

Available Get Functions used by CAM Library. More...

Functions

int camlib_GetLayerNames (char *value)
 Get all available layer names in a comma separated string. May be used after camlib_ActivateCell(). More...
 
int camlib_GetLayerNamesPerStackup (char *value)
 Get all available layer names in a comma separated string. Layers are ordered per design Stackup. May be used after camlib_ActivateCell(). More...
 
int camlib_GetFigure (int *nFigureType, int *nLayer, int *nPurpose, int *nCompositeLevel, char *net)
 Traverses all figures in the active cell. Starts from the first figure in the active cell, and keeps returning 1 until the last figure is reached; at that point -1 is returned. May be used after camlib_ActivateCell(). More...
 
int camlib_GetFigureIndex (int n, int *nFigureType, int *nLayer, int *nPurpose, int *nCompositeLevel, char *net)
 Traverses all figures in the active cell using the index value. May be used after camlib_ActivateCell(). More...
 
int camlib_GetFiguresCount ()
 Returns the total number of figures in the active cell. More...
 
int camlib_GetPolygon (int *nPointCount)
 Gets the point array for the current polygon figure. May be used after camlib_GetFigure(). More...
 
int camlib_GetLine (int *nPointCount)
 Gets the point array for the current line figure. May be used after camlib_GetFigure(). More...
 
int camlib_GetPath (int *nPointCount, float *fWidth, int *nPathType)
 Gets the point array, width, and path type for the current path figure. May be used after camlib_GetFigure(). More...
 
int camlib_GetArc (float *sx, float *sy, float *ex, float *ey, float *cx, float *cy, int *dir, float *fWidth, int *nPathType)
 Gets the point array, width, and path type for the current arc figure. May be used after camlib_GetFigure(). Arcs are only processed by ACE if camlib_UseArcs is set. More...
 
int camlib_GetText (char *textvalue, char *textstyle, float *x, float *y, float *height, float *angle, int *mirror, char *align)
 Gets the point array, width, and path type for the current arc figure. May be used after camlib_GetFigure . Arcs are only processed by ACE if camlib_UseArcs is set. More...
 
int camlib_GetFlash (float *x, float *y, int *dcode)
 Gets the location and dcode of a flash figure. May be used after camlib_GetFigure. More...
 
int camlib_GetInsert (char *insertname, float *x, float *y, float *angle, int *mirror, int *rows, int *cols, float *rowdist, float *coldist)
 Gets the insert name, insert location, angle, mirror, and array information for the insert figure. May be used after camlib_GetFigure. More...
 
int camlib_GetTessFigure (int *nPolygonCount)
 Converts any figure (except for insert) into a series of tessellated polygons. May be used after camlib_GetFigure. More...
 
int camlib_GetTessPoint (int nPolygon, int n, float *x, float *y)
 Used to extract the points used to construct a tessellated figure. May be used after camlib_GetTessFigure. More...
 
int camlib_GetOutlineFigure (int *nPolygonCount)
 Converts any figure (except for insert) into a series of polygons (cut-lines may be used for holes). May be used after camlib_GetFigure. More...
 
int camlib_GetOutlineCount (int *nPointCount)
 Gets the point array for the current outline polygon. May be used after camlib_GetOutlineFigure. More...
 
int camlib_GetOutlinePoint (int n, float *x, float *y)
 Used to extract the points used to construct a outline polygon. May be used after camlib_GetOutlineCount. More...
 
int camlib_GetPoint (int n, float *x, float *y)
 Used to extract the points from the current point array. May be used after camlib_GetPolygon camlib_GetLine camlib_GetPath. More...
 
int camlib_GetDrill (float *x, float *y, float *diameter)
 Gets the Drill center point and diameter tool size. More...
 
int camlib_GetCompositeLevel ()
 Returns the composite value for the active figure.
More...
 
int camlib_GetLayerNumber ()
 Returns the layer number for the active figure. More...
 
int camlib_GetPurposeNumber ()
 Returns the purpose number for the active figure. More...
 
int camlib_GetFigureType ()
 Returns the figure type for the active figure. See CAM_FigureType. More...
 
int camlib_GetDcode ()
 Returns the dcode number for the active figure. More...
 
int camlib_GetNcToolNumber ()
 Returns the NC tool number for the active figure. More...
 
int camlib_GetShapeType ()
 Calculates the type of shape for the active figure (i.e "Circle", "Rectangle", "Oblong", etc.). For all available shapes see, CAM_FlashType. More...
 
int camlib_GetNcToolType ()
 Returns the NC tool type for the active figure. See CAM_NCToolType. More...
 
int camlib_GetNcToolCompensation ()
 Returns the NC tool compensation index for the active figure. See CAM_CompensationSideType. More...
 
int camlib_GetNet (char *net)
 Gets the Net name for the active figure. More...
 
int camlib_GetCentroid (float *x, float *y, float *width, float *height)
 Gets the centroid, width, and height for the active figure. More...
 
int camlib_GetBoundingBox (float *fL, float *fB, float *fR, float *fT)
 Gets the bounding box for the active figure. More...
 

Detailed Description

Available Get Functions used by CAM Library.

Function Documentation

◆ camlib_GetArc()

int camlib_GetArc ( float *  sx,
float *  sy,
float *  ex,
float *  ey,
float *  cx,
float *  cy,
int *  dir,
float *  fWidth,
int *  nPathType 
)

Gets the point array, width, and path type for the current arc figure. May be used after camlib_GetFigure(). Arcs are only processed by ACE if camlib_UseArcs is set.

Parameters
sxStart point of arc. (X value in millimeters)
syStart point of arc. (Y value in millimeters)
exEnd point of arc. (X value in millimeters)
eyEnd point of arc. (Y value in millimeters)
cxCenter point of arc. (X value in millimeters)
cyCenter point of arc. (Y value in millimeters)
dirDirection type of arc. See CAM_ArcDirectionType
fWidthWidth of the path (in millimeters).
nPathTypePath type for the arc. See available Path types: CAM_PathType
Returns
Returns 0 if successful, else -1.
See also
Repeat calls to camlib_GetPoint is required to extract each point in the polygon.

◆ camlib_GetBoundingBox()

int camlib_GetBoundingBox ( float *  fL,
float *  fB,
float *  fR,
float *  fT 
)

Gets the bounding box for the active figure.

Parameters
fLLeft of active figure (X value in millimeters).
fBBottom of active figure (Y value in millimeters).
fRRight of active figure (in millimeters).
fTTop of active figure (in millimeters).
Returns
Returns 0 if successful, else -1.

◆ camlib_GetCentroid()

int camlib_GetCentroid ( float *  x,
float *  y,
float *  width,
float *  height 
)

Gets the centroid, width, and height for the active figure.

Parameters
xCenter of active figure (X value in millimeters).
yCenter of active figure (Y value in millimeters).
widthWidth of active figure (in millimeters).
heightHeight of active figure (in millimeters).
Returns
Returns 0 if successful, else -1.

◆ camlib_GetCompositeLevel()

int camlib_GetCompositeLevel ( )

Returns the composite value for the active figure.

See also
For more information about composites, please view the following link, https://support.numericalinnovations.com/support/discussions/topics/14000002372
Returns
Returns 0 or positive integer if successful, else -1.

◆ camlib_GetDcode()

int camlib_GetDcode ( )

Returns the dcode number for the active figure.

Returns
Returns 0 or positive integer if successful, else -1.

◆ camlib_GetDrill()

int camlib_GetDrill ( float *  x,
float *  y,
float *  diameter 
)

Gets the Drill center point and diameter tool size.

Parameters
xReturns the point location (X value in millimeters).
yReturns the point location (Y value in millimeters).
diameterPoint diameter of drill.
Returns
Returns 0 if successful, else -1.

◆ camlib_GetFigure()

int camlib_GetFigure ( int *  nFigureType,
int *  nLayer,
int *  nPurpose,
int *  nCompositeLevel,
char *  net 
)

Traverses all figures in the active cell. Starts from the first figure in the active cell, and keeps returning 1 until the last figure is reached; at that point -1 is returned. May be used after camlib_ActivateCell().

Note
This is different from camlib_Select_GetFigure() which only traverses selected figures.
Parameters
nFigureTypeType of figure.
nLayerLayer number of figure.
nPurposePurpose number of figure. (0 if not purpose number).
nCompositeLevelComposite level of figure. (0 if no composite level)
netNet name of the figure. (Empty string if not nets are present)
Returns
Returns 1 if successful, else -1.
Note
Please notice that 1 is returned if successful (not 0)

◆ camlib_GetFigureIndex()

int camlib_GetFigureIndex ( int  n,
int *  nFigureType,
int *  nLayer,
int *  nPurpose,
int *  nCompositeLevel,
char *  net 
)

Traverses all figures in the active cell using the index value. May be used after camlib_ActivateCell().

Note
This is different from camlib_Select_GetFigure() which only traverses selected figures.
Parameters
nIndex of figure in the active cell.
nFigureTypeType of figure.
nLayerLayer number of figure.
nPurposePurpose number of figure. (0 if not purpose number).
nCompositeLevelComposite level of figure. (0 if no composite level)
netNet name of the figure. (Empty string if not nets are present)
Returns
Returns 0 if successful, else -1.

◆ camlib_GetFiguresCount()

int camlib_GetFiguresCount ( )

Returns the total number of figures in the active cell.

Returns
Returns number of figures in the active cell.

◆ camlib_GetFigureType()

int camlib_GetFigureType ( )

Returns the figure type for the active figure. See CAM_FigureType.

Returns
Return values:
  • 0 = Nothing / Invalid
  • 1 = Represents a polygon figure that consists of a point array. Two coincident and three collinear points are illegal, and if detected, cause an exception to be thrown.
  • 2 = Represents a path figure that contains a point array, has defined width (greater than zero) and a path type.
  • 3 = Represents a line figure that contains a point array, has defined width of zero.
  • 4 = Represents a text figure that contains an insert point, text value, text style, height, angle, mirror, and alignment variable.
  • 5 = Represents a flashed figure that contains an insert point, and dcode value (which references an aperture table).
  • 6 = An insert represents the inclusion of one cell as a part of the contents of another. The cell containing the insert is the parent cell, and the cell that is included is the master cell of the insert. Inserts can create hierarchical designs. The master of an insert can contain inserts of other masters. This hierarchy can continue for as many levels as needed to express a complete design. An Insert consists of an insert point, insert name (master cell), angle, mirror. For arrayed inserts there are additional varialbes: row count, column count, row distance, column distance.
  • 7 = Represents an arc figire that contains a start point, end point, center point, direction, has defined width (greater than zero) and a path type.
  • -1 = Error

◆ camlib_GetFlash()

int camlib_GetFlash ( float *  x,
float *  y,
int *  dcode 
)

Gets the location and dcode of a flash figure. May be used after camlib_GetFigure.

Parameters
xInsert point of flash. (X value in millimeters)
yInsert point of flash. (Y value in millimeters)
dcodeDcode number used for flash.
Returns
Returns 0 if successful, else -1.

◆ camlib_GetInsert()

int camlib_GetInsert ( char *  insertname,
float *  x,
float *  y,
float *  angle,
int *  mirror,
int *  rows,
int *  cols,
float *  rowdist,
float *  coldist 
)

Gets the insert name, insert location, angle, mirror, and array information for the insert figure. May be used after camlib_GetFigure.

Parameters
insertnameName of master cell referenced by this insert.
xInsert point. (X value in millimeters)
yInsert point. (Y value in millimeters)
angleInsert Angle.
mirrorMirror of Insert. See CAM_MirrorType
rowsNumber of rows (for arrayed inserts only).
colsNumber of columns (for arrayed inserts only).
rowdistVertical distance between rows (for arrayed inserts only).
coldistHorizontal distance between columns (for arrayed inserts only).
Returns
Returns 0 if successful, else -1.

◆ camlib_GetLayerNames()

int camlib_GetLayerNames ( char *  value)

Get all available layer names in a comma separated string. May be used after camlib_ActivateCell().

Parameters
valueReturns all layers in a comma separated string.
Returns
Returns 0 if successful, else -1.

◆ camlib_GetLayerNamesPerStackup()

int camlib_GetLayerNamesPerStackup ( char *  value)

Get all available layer names in a comma separated string. Layers are ordered per design Stackup. May be used after camlib_ActivateCell().

Parameters
valueReturns all layers per stackup, in a comma separated string.
Returns
Returns 0 if successful, else -1.

◆ camlib_GetLayerNumber()

int camlib_GetLayerNumber ( )

Returns the layer number for the active figure.

Returns
Returns 0 or positive integer if successful, else -1.

◆ camlib_GetLine()

int camlib_GetLine ( int *  nPointCount)

Gets the point array for the current line figure. May be used after camlib_GetFigure().

Parameters
nPointCountTotal number of points defined for the line.
Returns
Returns 0 if successful, else -1.
See also
Repeat calls to camlib_GetPoint is required to extract each point in the polygon.

◆ camlib_GetNcToolCompensation()

int camlib_GetNcToolCompensation ( )

Returns the NC tool compensation index for the active figure. See CAM_CompensationSideType.

Returns
Return values:
  • 0 = No NC Path Compensation
  • 1 = NC Path compensation on the left side
  • 2 = NC Path compensation on the right side
  • -1 = Error

◆ camlib_GetNcToolNumber()

int camlib_GetNcToolNumber ( )

Returns the NC tool number for the active figure.

Returns
Returns 0 or positive integer if successful, else -1.

◆ camlib_GetNcToolType()

int camlib_GetNcToolType ( )

Returns the NC tool type for the active figure. See CAM_NCToolType.

Returns
Return values:
  • 0 = No specific NC Type is defined. Typically these figures will be a standard drill hit or rout nc path.
  • 32 = Routed Circle (Clockwise).
  • 33 = Routed Circle (Counter-Clockwise).
  • 84 = Drilled Circle.
  • 85 = Drilled Slot.
  • 87 = Canned Cycle Routed slot.
  • 97 = Text drilled horizontally.
  • 98 = Text drilled vertically.
  • -1 = Error

◆ camlib_GetNet()

int camlib_GetNet ( char *  net)

Gets the Net name for the active figure.

Parameters
netReturns the net name.
Returns
Returns 0 if successful, else -1.

◆ camlib_GetOutlineCount()

int camlib_GetOutlineCount ( int *  nPointCount)

Gets the point array for the current outline polygon. May be used after camlib_GetOutlineFigure.

Note
Must be used in conjunction with function camlib_GetOutlinePoint
Parameters
nPointCountReturns the number of points used in the current outline polygon.
Returns
Returns 0 if successful, else -1.

◆ camlib_GetOutlineFigure()

int camlib_GetOutlineFigure ( int *  nPolygonCount)

Converts any figure (except for insert) into a series of polygons (cut-lines may be used for holes). May be used after camlib_GetFigure.

Note
Must be used in conjunction with function camlib_GetOutlineCount and camlib_GetOutlinePoint
Parameters
nPolygonCountReturns the number of polygons used to outline the figure.
Returns
Returns 0 if successful, else -1.

◆ camlib_GetOutlinePoint()

int camlib_GetOutlinePoint ( int  n,
float *  x,
float *  y 
)

Used to extract the points used to construct a outline polygon. May be used after camlib_GetOutlineCount.

Parameters
nPoint count of current polygon. May not exceed nPointCount from camlib_GetOutlineCount
xReturns the point location (X value in millimeters).
yReturns the point location (Y value in millimeters).
Returns
Returns 0 if successful, else -1.

◆ camlib_GetPath()

int camlib_GetPath ( int *  nPointCount,
float *  fWidth,
int *  nPathType 
)

Gets the point array, width, and path type for the current path figure. May be used after camlib_GetFigure().

Parameters
nPointCountTotal number of points defined for the path.
fWidthWidth of the path (in millimeters).
nPathTypePath type for the path. See available Path types: CAM_PathType
Returns
Returns 0 if successful, else -1.
See also
Repeat calls to camlib_GetPoint is required to extract each point in the polygon.

◆ camlib_GetPoint()

int camlib_GetPoint ( int  n,
float *  x,
float *  y 
)

Used to extract the points from the current point array. May be used after camlib_GetPolygon camlib_GetLine camlib_GetPath.

Parameters
nPoint count of current point array.
xReturns the point location (X value in millimeters).
yReturns the point location (Y value in millimeters).
Returns
Returns 0 if successful, else -1.

◆ camlib_GetPolygon()

int camlib_GetPolygon ( int *  nPointCount)

Gets the point array for the current polygon figure. May be used after camlib_GetFigure().

Parameters
nPointCountTotal number of points defined for the polygon.
Returns
Returns 0 if successful, else -1.
See also
Repeat calls to camlib_GetPoint is required to extract each point in the polygon.

◆ camlib_GetPurposeNumber()

int camlib_GetPurposeNumber ( )

Returns the purpose number for the active figure.

Returns
Returns 0 or positive integer if successful, else -1.

◆ camlib_GetShapeType()

int camlib_GetShapeType ( )

Calculates the type of shape for the active figure (i.e "Circle", "Rectangle", "Oblong", etc.). For all available shapes see, CAM_FlashType.

Returns
Returns 0 or positive integer if successful, else -1.

◆ camlib_GetTessFigure()

int camlib_GetTessFigure ( int *  nPolygonCount)

Converts any figure (except for insert) into a series of tessellated polygons. May be used after camlib_GetFigure.

Parameters
nPolygonCountInsert point of flash. (X value in millimeters)
Returns
Returns 0 if successful, else -1.
Note
Must be used in conjunction with function camlib_GetTessPoint

◆ camlib_GetTessPoint()

int camlib_GetTessPoint ( int  nPolygon,
int  n,
float *  x,
float *  y 
)

Used to extract the points used to construct a tessellated figure. May be used after camlib_GetTessFigure.

Parameters
nPolygon# of polygon to process. May not exceed the nPolygonCount from camlib_GetTessFigure
nPoint count of current polygon. May not exceed 3. A tessellated polygon is a triangle, so it will not exceed 3 points.
xThe point location (X value in millimeters).
yThe point location (Y value in millimeters).
Returns
Returns 0 if successful, else -1.

◆ camlib_GetText()

int camlib_GetText ( char *  textvalue,
char *  textstyle,
float *  x,
float *  y,
float *  height,
float *  angle,
int *  mirror,
char *  align 
)

Gets the point array, width, and path type for the current arc figure. May be used after camlib_GetFigure . Arcs are only processed by ACE if camlib_UseArcs is set.

Parameters
textvalueStart point of arc.
textstyleStart point of arc.
xInsert point of text. (X value in millimeters)
yInsert point of text. (Y value in millimeters)
heightHeight of text (in millimeters).
angleAngle of text.
mirrorMirror of text. See CAM_MirrorType
alignWidth of the path in millimeters.
Returns
Returns 0 if successful, else -1.