<< Click to Display Table of Contents > 

Client Control Interface Manual > Programming Examples > Create Entity > Text2D

Text2D
Previous pageReturn to chapter overviewNext page

Create a new text entity with various properties

 

// Define the type of the new entity

int CCI_Return_01 = cci.ScSetStringValue( ( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlStringValueTypeCreateEntity, "ScWinTextChars2D" );

// Set Arial as font

int CCI_Return_02 = cci.ScSetEntityStringData( "ScCreateEntity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdTextFontName, "Arial" );

//  Set text weight to bold

int CCI_Return_03 = cci.ScSetEntityLongData( "ScCreateEntity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextWeight, 700 );

// Enable font property italic

int CCI_Return_04 = cci.ScSetEntityLongData( "ScCreateEntity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextCharFlags, (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextCharFlagItalic );

// Set the text to "Hey!"

int CCI_Return_05 = cci.ScChangeTextByName( "ScCreateEntity", "Hey!" );

// Set font size to 9.0 mm

int CCI_Return_06 = cci.ScSetEntityDoubleData( "ScCreateEntity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdTextSize, 9.0 );

// Create a toplevel entity "New Entity" with predefined parameters, assign pen number 3, set the center of entity to x = 20.0 mm, y = 10.0 mm, z = 0.0 mm and use dim_x = 0.0 mm and dim_y = 0.0 mm to keep the font size

int CCI_Return_07 = cci.ScCreateEntity( "New Entity", "", 3, 20.0, 10.0, 0.0, 0.0, 0.0, 0, "" );

Table 397: Create text entity (ScWinTextChars2D)