<< Click to Display Table of Contents > 

Client Control Interface Manual > Base Functions

Base Functions
Previous pageReturn to chapter overviewNext page

This chapter explains some of the major functions needed to realize a CCI application. These basic commands can then be used in combination with the CCI constants. For each function, a small example in C# is given.
The commands given in this chapter are:

 

DoubleValue

EntityDoubleData

EntityLongData

EntityStringData

ExecCommand

IDStringData

LongValue

StringValue

 

DoubleValue
 

Set

Get

DLL Function

int CCI_Return = ScSetDoubleValue(int Value_Type, double Parameter)

double Parameter = ScGetDoubleValue(int Value_Type)

ASCII Function

int CCI_Return = ScCciSetDoubleValue(int Value_Type, double Parameter)

double Parameter = ScCciGetDoubleValue(int Value_Type)

Description

This is the definition of the base function to use Double Value Types. The function needs two arguments: Value_Type and Parameter. The available Value_Types are listed at List of Constants → Double Value Types.

Value_Type

Type: int

Location: ScComSAMLightClientCtrlValueTypes

See available Double Value Types.

Parameter

Type: double

Unit: depends on constant

Further details are given in Double Value Types.

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: How to use DoubleValue Types:

 

// Set maximum mark speed to 200.0 mm/s

int CCI_Return = cci.ScSetDoubleValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeMaxMarkSpeed, 200.0 );

 

// Get maximum mark speed

double Max_Mark_Speed = cci.ScGetDoubleValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeMaxMarkSpeed );

Table 1: DoubleValue

EntityDoubleData
 

Set

Get

DLL Function

int CCI_Return = ScSetEntityDoubleData(string Entity_Name, int Data_ID, double Parameter)

int CCI_Return = ScGetEntityDoubleData(string Entity_Name, int Data_ID, ref double Parameter)

ASCII Function

int CCI_Return = ScCciSetEntityDoubleData(string Entity_Name, int Data_ID, double Parameter)

double Parameter = ScCciGetEntityDoubleData(string Entity_Name, int Data_ID)

Description

This is the definition of the base function to use Entity Double Data IDs. The function needs two/three arguments: Entity_Name, Data_ID and Parameter. Sometimes the function returns the parameter or the parameter has to be initialized before. The available Data_IDs are listed at List of Constants → Double Data IDs.

Entity_Name

Type: string

Unit: none

Specify the entity based on the name.

Data_ID

Type: int

Location: ScComSAMLightClientCtrlFlags

See available Double Data IDs.

Data_ID can be combined with:

scComSAMLightClientCtrlDoubleDataIdFlagDontUpdateView 0x10000 (set only)
The view will not be updated to increase the performance.

scComSAMLightClientCtrlDoubleDataIdFlagDontUpdateEntity 0x20000 (set only)
The vectors will not be updated to increase the performance.

scComSAMLightClientCtrlDoubleDataIdFlagToplevelOnly 0x40000
Only entities in the top level of the job will be considered to increase the performance.

Parameter

Type: double

Unit: none

Set or get the required data. Further details are given in the Double Data IDs.

CCI_Return

Type: int

CCI return number, see error list.

Notes

Set function also available for SAM3D. No get function.

C# Example: How to use EntityDoubleDataIDs:

 

// Set line spacing value to 200%

int CCI_Return_01 = cci.ScSetEntityDoubleData( "Text_Entity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdTextLineSpacing, 200.0 );

 

// Get line spacing value

double Text_Line_Spacing = 0.0;

int CCI_Return_02 = cci.ScGetEntityDoubleData( "Text_Entity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdTextLineSpacing, ref Text_Line_Spacing );

Table 2: EntityDoubleData

EntityLongData
 

Set

Get

DLL Function

int CCI_Return = ScSetEntityLongData(string Entity_Name, int Data_ID, int Parameter)

int Parameter = ScGetEntityLongData(string Entity_Name, int Data_ID)

ASCII Function

int CCI_Return = ScCciSetEntityLongData(string Entity_Name, int Data_ID, int Parameter)

int Parameter = ScCciGetEntityLongData(string Entity_Name, int Data_ID)

Description

This is the definition of the base function to use Entity Long Data IDs. The function needs two/three arguments: Entity_Name, Data_ID and Parameter. Sometimes the function returns the parameter or the parameter has to be initialized before. The available Data_IDs are listed at List of Constants → Long Data IDs.

Entity_Name

Type: string

Unit: none

Specify the entity based on the name.

Data_ID

Type: int

Location: ScComSAMLightClientCtrlFlags

See available Long Data IDs.

Data_ID can be combined with following ScComSAMLightClientCtrlFlags:

scComSAMLightClientCtrlLongDataIdFlagDontUpdateView 0x10000 (set only)
The view will not be updated to increase the performance.

scComSAMLightClientCtrlLongDataIdFlagDontUpdateEntity 0x20000 (set only)
The vectors will not be updated to increase the performance.

Parameter

Type: int

Unit: none

See available Long Data IDs.

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: How to use EntityLongDataIDs:
 

// Set current setting for text alignment line center

int CCI_Return = cci.ScSetEntityLongData( "Text_Entity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextAlignment, 1024 );

 

// Get current setting for text alignment line center

int Text_Alignment = cci.ScGetEntityLongData( "Text_Entity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextAlignment );

Table 3: EntityLongData

EntityStringData
 

Set

Get

DLL Function

int CCI_Return = ScSetEntityStringData(string Entity_Name, int Data_ID, string Parameter)

int CCI_Return = ScGetEntityStringData(string Entity_Name, int Data_ID, ref string Parameter)

ASCII Function

int CCI_Return = ScCciSetEntityStringData(string Entity_Name, int Data_ID, string Parameter)

string Parameter = ScCciGetEntityStringData(string Entity_Name, int Data_ID)

Description

Set or get specific string data of an entity Entity_Name depending on the Data_ID.

Entity_Name

Type: string

Unit: none

Specify the entity based on the name.

Data_ID

Type: int

Location: ScComSAMLightClientCtrlFlags

See available Entity String Data IDs.

Data_ID can be combined with following ScComSAMLightClientCtrlFlags:

scComSAMLightClientCtrlStringDataIdFlagDontUpdateView 0x10000 (set only)
The view will not be updated to increase the performance.

scComSAMLightClientCtrlStringDataIdFlagDontUpdateEntity 0x20000 (set only)
The vectors will not be updated to increase the performance.

scComSAMLightClientCtrlStringDataIdFlagToplevelOnly 0x200000
Only entities in the top level of the job will be considered to increase the performance.

Parameter

Type: string

Unit: none

The corresponding value.

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: How to use Entity String Data IDs

 
// Set content of text entity

int CCI_Return_01 = cci.ScSetEntityStringData( "Text_Entity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdTextText, "Test" );

 
// Get content of text entity

string Entity_Text = "";

int CCI_Return_02 = cci.ScGetEntityStringData( "Text_Entity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdTextText, ref Entity_Text );

Table 4: EntityStringData

Exec Command
 

Set

Get

DLL Function

int CCI_Return = ScExecCommand(int Cmd_ID)

ASCII Function

int CCI_Return = ScCciExecCommand(int Cmd_ID)

Description

This is the definition of the base function to use Exec Commands. Only the Cmd_ID has to be given. The available Cmd_IDs are listed at List of Constants → Cmd ID.

Cmd_ID

Type: int

Location: ScComSAMLightClientCtrlExecCommandConstants

See available Cmd IDs.

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: How to use Exec Commands:

 

// Create new job

int CCI_Return = cci.ScExecCommand( ( int )ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandNewJob );

Table 5: ExecCommand

IDStringData
 

Set  

Get

DLL Function

int CCI_Return = ScSetIDStringData(int Data_ID, int Index, string Parameter)

int CCI_Return = ScGetIDStringData(int Data_ID, int Index, ref string Parameter)

ASCII Function

int CCI_Return = ScCciSetIDStringData(int Data_ID, int Index, string Parameter)

string Parameter = ScCciGetIDStringData(int Data_ID, int Index)

Description

Set or get specific string data of an entity by Index depending on the Data_ID.

Data_ID

Type: int

Location: ScComSAMLightClientCtrlValueTypes

See available ID String Data IDs.

Index

Type: int

Unit: none

0 based entity index of current job.

Index can be combined with following ScComSAMLightClientCtrlFlags:

scComSAMLightClientCtrlStringDataIdFlagDontUpdateView 0x10000 (set only)
The view will not be updated to increase the performance.

scComSAMLightClientCtrlStringDataIdFlagDontUpdateEntity 0x20000 (set only)
The vectors will not be updated to increase the performance.

scComSAMLightClientCtrlStringDataIdFlagToplevelOnly 0x200000
Only entities in the top level of the job will be considered to increase the performance.

Parameter

Type: string

Unit: none

The corresponding value.

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: How to use ID String Data IDs

 

int Top_Level_Entity_Num = cci.ScGetLongValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeTopLevelEntityNum );

 

for( int i = 0; i < Top_Level_Entity_Num; i++ )

{

  // Set entity name by index

  int CCI_Return_01 = cci.ScSetIDStringData( ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdSetEntityName, i | ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdFlagToplevelOnly, "Entity_" + Convert.ToString(i) );

 

  // Get entity name by index

  string Entity_Name = "";

  int CCI_Return_02 = cci.ScGetIDStringData( ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdGetEntityName, i | ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdFlagToplevelOnly, ref Entity_Name );

}

Table 6: IDStringData

LongValue
 

Set

Get

DLL Function

int CCI_Return = ScSetLongValue(int Value_Type, int Parameter)

int Parameter = ScGetLongValue(int Value_Type)

ASCII Function

int CCI_Return = ScCciSetLongValue(int Value_Type, int Parameter)

int Parameter = ScCciGetLongValue(int Value_Type)

Description

This is the definition of the base function to use Long Value Types. The function needs two arguments: Value_Type and Parameter. The available Value_Types are listed at List of Constants → Long Value Types.

Value_Type

Type: int

Location: ScComSAMLightClientCtrlValueTypes

See available Long Value Types.

Parameter

Type: int

Unit: depends on constant

Further details are given in Long Value Types.

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: How to use Long Value Types

 

// Set job execution delay to 100 ms

int CCI_Return = cci.ScSetLongValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeJobExecutionDelay, 100 );

 

// Get job execution delay

double Job_Execution_Delay = cci.ScGetLongValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeJobExecutionDelay );

Table 7: LongValue

StringValue
 

Set

Get

DLL Function

int CCI_Return = ScSetStringValue(int Value_Type, string Parameter)

int CCI_Return = ScGetStringValue(int Value_Type, ref string Parameter)

ASCII Function

int CCI_Return = ScCciSetStringValue(int Value_Type, string Parameter)

string Parameter = ScCciGetStringValue(int Value_Type)

Description

This is the definition of the base function to use String Value Types. The function needs two arguments: Value_Type and Parameter. The available Value_Types are listed at List of Constants → String Value Types.

Value_Type

Type: int

Location: ScComSAMLightClientCtrlValueTypes

See available String Value Type.

Parameter

Type: string

Unit: none

See available String Value Types.

CCI_Return

Type: int

CCI return number, see error list.

Notes

-

C# Example: How to use String Value Types

 

// Set name of current pen

int CCI_Return = cci.ScSetStringValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlStringValueTypeCurrentPenName, "Test Pen" );

 

// Get current pen name

string pen_name = "";

int CCI_Return = cci.ScGetStringValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlStringValueTypeCurrentPenName, ref pen_name );

Table 8: StringValue