CAM Library
API Reference
Primary Functions

Required Functions for CAM Library. More...

Functions

int camlib_Initialize (int argc, char *argv[])
 Initializes CAM Library.
More...
 
int camlib_Initialize_SessionID (int argc, char *argv[], char *sTempFolder)
 Initializes CAM Library using a defined temporary folder. Assigning a temporary folder can be helpful to avoid file/folder conflicts when running multiple processes of CAM Library simultaneously. This must be the first API function call for CAM Library (or camlib_Initialize), and it is required. The temporary folder must be an absolute path (i.e full-path). More...
 
int camlib_ActivateImport ()
 Starts the CAM Library Import Engine. More...
 
int camlib_ActivateCell (char *value)
 Sets the Top Cell used to activate (i.e make current). Either camlib_ActivateCellFlattenHierarchy or camlib_ActivateCell function is Required. More...
 
int camlib_ActivateCellFlattenHierarchy (char *value)
 Activates the Top Cell and flattens all hierarchy (if any). Either camlib_ActivateCellFlattenHierarchy or camlib_ActivateCell function is Required. More...
 
int camlib_ActivateExport ()
 Starts the CAM Library Export Engine. This function is only necessary when exporting to an external file. More...
 
int camlib_Finalize ()
 Free all memory used by CAM Library. camlib_Finalize is Required. More...
 
int camlib_SaveActiveCell ()
 Save active cell. More...
 
int camlib_VerifyLicense (char *value)
 Assigns your license key to CAM Library. More...
 
int camlib_VerifyLicenseFile (char *value)
 Assigns your license file to CAM Library. More...
 
int camlib_VerifyActivationCode (char *value)
 Assigns your Activation Code to CAM Library. More...
 
int camlib_SaveWorkspace (char *value)
 Save design to an external file (*.wrk) More...
 
int camlib_OpenWorkspace (char *value)
 Open a workspace file (*.wrk) More...
 

Detailed Description

Required Functions for CAM Library.

Function Documentation

◆ camlib_ActivateCell()

int camlib_ActivateCell ( char *  value)

Sets the Top Cell used to activate (i.e make current). Either camlib_ActivateCellFlattenHierarchy or camlib_ActivateCell function is Required.

Sample C++ Code:

int result = camlib_ActivateCell( activeCellName );

Sample Node.js Code:

var resultActivateCell = camlib_ActivateCell(activeCellName);
if (resultActivateCell == -1) {
console.log("Couldn't Activate Current Cell: " + activeCellName + "\n");
throw new TypeError('Could not Activate Current Cell: ' + activeCellName);
}
Parameters
valueName of cell to activate.
Returns
Returns 0 if successful, else -1.
Note
Either camlib_ActivateCellFlattenHierarchy or camlib_ActivateCell function is Required.
See also
camlib_ActivateCellFlattenHierarchy

◆ camlib_ActivateCellFlattenHierarchy()

int camlib_ActivateCellFlattenHierarchy ( char *  value)

Activates the Top Cell and flattens all hierarchy (if any). Either camlib_ActivateCellFlattenHierarchy or camlib_ActivateCell function is Required.

Sample C++ Code:

int result = camlib_ActivateCellFlattenHierarchy( activeCellName );

Sample Node.js Code:

var resultActivateCell = camlib_ActivateCellFlattenHierarchy(activeCellName);
if (resultActivateCell == -1) {
console.log("Couldn't Activate Current Cell: " + activeCellName + "\n");
throw new TypeError('Could not Activate Current Cell: ' + activeCellName);
}
Parameters
valueName of cell to activate.
Returns
Returns 0 if successful, else -1.
Note
Either camlib_ActivateCellFlattenHierarchy or camlib_ActivateCell function is Required.
See also
camlib_ActivateCell

◆ camlib_ActivateExport()

int camlib_ActivateExport ( )

Starts the CAM Library Export Engine. This function is only necessary when exporting to an external file.

Returns
Returns 0 if successful, else -1.
Note
This function is only necessary when exporting to an external file.
See also
camlib_ActivateCell

◆ camlib_ActivateImport()

int camlib_ActivateImport ( )

Starts the CAM Library Import Engine.

Returns
Returns 0 if successful, else -1.
Note
This function is required.
See also
camlib_Initialize

◆ camlib_Finalize()

int camlib_Finalize ( )

Free all memory used by CAM Library. camlib_Finalize is Required.

Returns
Returns 0 if successful, else -1.
Note
camlib_Finalize is Required.

◆ camlib_Initialize()

int camlib_Initialize ( int  argc,
char *  argv[] 
)

Initializes CAM Library.

This must be the first API function call for CAM Library (or camlib_Initialize_SessionID), and it is required.

Note
When CAM Library runs, it requires a temporary folder for all it's internal processing files, etc.
If you will be running more than one instance of CAM Library simultaneously, you will need use
See also
camlib_Initialize_SessionID() instead of camlib_Initialize().

Sample C++ Code:

int result = camlib_Initialize( argc, argv );

Sample Node.js Code:

var sPath = [path.join(__dirname,"./bin")];
var resultInitialize = camlib_Initialize(1, sPath);
if (resultInitialize == -1) {
console.log("Couldn't Initialize Cam Library!\n");
throw new TypeError('Could not Initialize Cam Library');
}
Parameters
argcNumber of arguments.
argvArgument variables.
Returns
Returns 0 if successful, else -1.
Note
argv[0] must be the full path for CAM Library.
See also
camlib_Initialize_SessionID

◆ camlib_Initialize_SessionID()

int camlib_Initialize_SessionID ( int  argc,
char *  argv[],
char *  sTempFolder 
)

Initializes CAM Library using a defined temporary folder. Assigning a temporary folder can be helpful to avoid file/folder conflicts when running multiple processes of CAM Library simultaneously. This must be the first API function call for CAM Library (or camlib_Initialize), and it is required. The temporary folder must be an absolute path (i.e full-path).

Note
It is the users responsiblity to ensure the Temporary folder has write permission, and is not used by another process. Caution: Any pre-existing data in the temporary folder may be overwritten.

IMPORTANT: When using camlib_Initialize_SessionID(), you are responsible for the following:

  1. Create a unique temporary folder.
  2. Run CAM Library and use camlib_Initialize_SessionID(), with the sSessionID argument the absolute path of the unique temp folder you created.
  3. After CAM Library has completed, you are responsible for deleting that temporary folder.

Sample C++ Code:

int result = camlib_Initialize_SessionID( argc, argv, sTempFolder );

Sample Node.js Code:

var sPath = [path.join(__dirname,"./bin")];
var resultInitialize = camlib_Initialize_SessionID(1, sPath, "C:\Users\Numerical\AppData\Local\Temp\RyMiloo");
if (resultInitialize == -1) {
console.log("Couldn't Initialize Cam Library with sessionID!\n");
throw new TypeError('Could not Initialize Cam Library with sessionID');
}
Parameters
argcNumber of arguments.
argvArgument variables. argv[0] must be the full path for CAM Library.
sTempFolderAssign a specific temporary folder to avoid any conflicts with other running services. Must be full-path.
Returns
Returns 0 if successful, else -1.
Note
argv[0] must be the full path for CAM Library.
sTempFolder must be the full path for the Temporary folder used by CAM Library.
This function is required.
See also
camlib_Initialize

◆ camlib_OpenWorkspace()

int camlib_OpenWorkspace ( char *  value)

Open a workspace file (*.wrk)

Parameters
valueThe file path for the workspace file.
Returns
Returns 0 if successful, else -1.

◆ camlib_SaveActiveCell()

int camlib_SaveActiveCell ( )

Save active cell.

Sample C++ Code:

CamLib.camlib_SaveActiveCell();

Sample Node.js Code:

var resultFinalize = camlib_SaveActiveCell();
if (resultFinalize == -1) {
console.log("Couldn't SaveActiveCell\n");
throw new TypeError('Could not SaveActiveCell');
}
See also
camlib_SaveWorkspace
Returns
Returns 0 if successful, else -1.

◆ camlib_SaveWorkspace()

int camlib_SaveWorkspace ( char *  value)

Save design to an external file (*.wrk)

Parameters
valueThe file path to store the workspace file.
Returns
Returns 0 if successful, else -1.

◆ camlib_VerifyActivationCode()

int camlib_VerifyActivationCode ( char *  value)

Assigns your Activation Code to CAM Library.

Here's a sample activation code you will receive from Numerical Innovations: CL23AG34DFJT54

Sample C++ Code:

int result = camlib_VerifyActivationCode( "CL23AG34DFJT54" );
if (result==-1) throw( 0 );

Sample Node.js Code:

var resultLicense = CamLib.camlib_VerifyActivationCode("CL23AG34DFJT54");
if (resultLicense == -1) {
console.log("Couldn't Verify License\n");
throw new TypeError('Could not Verify License for Cam Library');
}
Parameters
valueLicense key.
Returns
Returns 0 if successful, else -1.
See also
camlib_VerifyLicenseFile
camlib_VerifyLicense

◆ camlib_VerifyLicense()

int camlib_VerifyLicense ( char *  value)

Assigns your license key to CAM Library.

Since the license key contains multiple lines you will need to modify the license key before sending it to camlib_VerifyLicense().

Here's a sample license key you will receive from Numerical Innovations:

FEATURE qtranss numinno 3.1 permanent uncounted HOSTID=ANY \
NOTICE=licensed@user.com;qtrans;0 TS_OK SIGN="0AF1 B680 A7D8 \
G928 161B 02A7 3FDB AC28 E63B 72B6 25F1 B712 4F1C 38A4 F2F4 \
122B 253E 2922 B4C1 5B29 914F 3E00 9F26 E130 638F 22DA 7225 \
05DE DAEB 8105"

You will need to modify the license key string before sending it to camlib_VerifyLicense(). Make sure that you replace \ with \\ , and make sure to add a newline character at the end of each line. See below for an example and compare the difference:

Modified License Key:

char sLicenseKey[1000];
strcpy( sLicenseKey, "FEATURE qtranss numinno 3.1 permanent uncounted HOSTID=ANY \\\n" );
strcat( sLicenseKey, "NOTICE=licensed@user.com;qtrans;0 TS_OK SIGN=\"0AF1 B680 A7D8 \\\n" );
strcat( sLicenseKey, "G928 161B 02A7 3FDB AC28 E63B 72B6 25F1 B712 4F1C 38A4 F2F4 \\\n" );
strcat( sLicenseKey, "122B 253E 2922 B4C1 5B29 914F 3E00 9F26 E130 638F 22DA 7225 \\\n" );
strcat( sLicenseKey, "05DE DAEB 8105\"" );

Sample C++ Code:

int result = camlib_VerifyLicense( sLicenseKey );
if (result==-1) throw( 0 );

Sample Node.js Code:

var sCamLibLicensePath = path.join(__dirname,"./bin/license.lic");
var resultLicense = CamLib.camlib_VerifyLicenseFile(sCamLibLicensePath);
if (resultLicense == -1) {
console.log("Couldn't Verify License\n");
throw new TypeError('Could not Verify License for Cam Library');
}
Parameters
valueLicense key.
Returns
Returns 0 if successful, else -1.
See also
camlib_VerifyLicenseFile
camlib_VerifyActivationCode

◆ camlib_VerifyLicenseFile()

int camlib_VerifyLicenseFile ( char *  value)

Assigns your license file to CAM Library.

Sample C++ Code:

int result = camlib_VerifyLicenseFile( sLicenseFile );
if (result==-1) throw( 0 );

Sample Node.js Code:

var sCamLibLicensePath = path.join(__dirname,"./bin/license.lic");
var resultLicense = CamLib.camlib_VerifyLicenseFile(sCamLibLicensePath);
if (resultLicense == -1) {
console.log("Couldn't Verify License\n");
throw new TypeError('Could not Verify License for Cam Library');
}
Parameters
valueLicense key file path.
Returns
Returns 0 if successful, else -1.
See also
camlib_VerifyActivationCode
camlib_VerifyLicense
camlib_SaveActiveCell
int camlib_SaveActiveCell()
Save active cell.
camlib_VerifyActivationCode
int camlib_VerifyActivationCode(char *value)
Assigns your Activation Code to CAM Library.
camlib_VerifyLicenseFile
int camlib_VerifyLicenseFile(char *value)
Assigns your license file to CAM Library.
camlib_VerifyLicense
int camlib_VerifyLicense(char *value)
Assigns your license key to CAM Library.
camlib_Initialize
int camlib_Initialize(int argc, char *argv[])
Initializes CAM Library.
camlib_Initialize_SessionID
int camlib_Initialize_SessionID(int argc, char *argv[], char *sTempFolder)
Initializes CAM Library using a defined temporary folder. Assigning a temporary folder can be helpful...
camlib_ActivateCellFlattenHierarchy
int camlib_ActivateCellFlattenHierarchy(char *value)
Activates the Top Cell and flattens all hierarchy (if any). Either camlib_ActivateCellFlattenHierarch...
camlib_ActivateCell
int camlib_ActivateCell(char *value)
Sets the Top Cell used to activate (i.e make current). Either camlib_ActivateCellFlattenHierarchy or ...