<< Click to Display Table of Contents > Text2D |
☒ Set ☐ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScChangeTextByName(string Entity_Name, string Text) |
||
ASCII Function |
int CCI_Return = ScCciChangeTextByName(string Entity_Name, string Text) |
||
Description |
The string of the text object with the given Entity_Name can be set to the string specified by the parameter Text. This function allows the dynamic change of text objects. The different text objects are identified by their name. |
||
Entity_Name |
Type: string |
Unit: none |
|
•Specify the entity to be changed •An empty string for a name in the parameter Text is valid too. |
|||
Text |
Type: string |
Unit: none |
|
Enter the new text. |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•It also possible to change the text of more than one entities with one function call. Therefore set the Flag NamesSeparatedBySemicolon. Then separate the different Entity_Names with a semicolon ';'. If you want to give the each entity a different new string separate these strings by a vertical tab in the parameter Text. •In C and C++ the vertical tab equals a '\v' whereas in Visual Basic the vertical tab is ( vbVerticalTab ). Then the number of Entity_Names must be the same as the number of names in the parameter Text. |
||
C# Example: Set text of "text1" entity to "Hey!":
int CCI_Return = cci.ScChangeTextByName( "text1", "Hey!" ); |
Table 162: Change Text
|
☒ Set ☒ Get |
||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetEntityStringData(string Entity_Name, int Data_ID, string Text) int CCI_Return = ScGetEntityStringData(string Entity_Name, int Data_ID, ref string Text) |
||
ASCII Function |
int CCI_Return = ScCciSetEntityStringData(string Entity_Name, int Data_ID, string Text) string Text = ScCciGetEntityStringData(string Entity_Name, int Data_ID) |
||
Description |
Edit the text of the Text2D entity or change the font |
||
Entity_Name |
Type: string |
Unit: none |
|
Specify the entity to be changed |
|||
Data_ID |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlStringDataIdTextFontName |
1 |
||
Change the text font. |
|||
scComSAMLightClientCtrlStringDataIdTextText |
2 |
||
Change the text itself. |
|||
Text |
Type: string |
Unit: none |
|
The corresponding text parameter. |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
- |
||
C# Example: Change the content of the "text1" entity and set "Arial" as font: int CCI_Return_02 = cci.ScSetEntityStringData("text1", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdTextText, "New Part"); |
|||
C# Example: Get the current content of the "text1" text entity: int CCI_Return = cci.ScGetEntityStringData("text1", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdTextText, ref current_Text); |
Table 163: Change Text and Font
☐ Set ☒ Get |
|||
---|---|---|---|
DLL Function |
int Font_Available = ScGetEntityLongData(string Entity_Name, int Data_ID) |
||
ASCII Function |
int Font_Available = ScCciGetEntityLongData(string Entity_Name, int Data_ID) |
||
Description |
This constant will examine if for the given Entity_Name the specified font is available on the PC on which SAMLight is currently running. The return value will be 1 if the fonts is available 0 if it is not. |
||
Entity_Name |
Type: string |
Unit: none |
|
Specify the entity to be changed. |
|||
Data_ID |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlLongDataIdTextFontAvailable |
10 |
||
Font_Available |
Type: int |
Unit: none |
|
•0: Not avaliable. •1: Avaliable. |
|||
Notes |
- |
||
C# Example:
int font_available = cci.ScGetEntityLongData("text1", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextFontAvailable); |
Table 164: Check Font Availability
Find Entity with Text |
☐ Set ☒ Get |
||
---|---|---|---|
DLL Function |
int CCI_Return = ScGetEntityStringData(string Entity_Name, int Data_ID, ref string Parameter) |
||
ASCII Function |
string Parameter = ScCciGetEntityStringData(string Entity_Name, int Data_ID) |
||
Description |
Sucht Entity mit übergebenem Textinhalt, gibt Name des Entities zurück. |
||
Entity_Name |
Type: string |
Unit: none |
|
Specify the entity based on the name. |
|||
Data_ID |
Type: int |
||
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlStringDataIdFindEntityWithText |
|
||
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 int CCI_Return_01 = cci.ScSetEntityStringData( "Text_Entity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdTextText, "Test" ); string Entity_Text = ""; int CCI_Return_02 = cci.ScGetEntityStringData( "Text_Entity", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlStringDataIdTextText, ref Entity_Text ); |
Table 165: Find Entity with Text
☒ Set ☒ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetEntityLongData(string Entity_Name, int Data_ID, int Spacing_Mode) int Spacing_Mode = ScGetEntityLongData(string Entity_Name, int Data_ID) |
||
ASCII Function |
int CCI_Return = ScCciSetEntityLongData(string Entity_Name, int Data_ID, int Spacing_Mode) int Spacing_Mode = ScCciGetEntityLongData(string Entity_Name, int Data_ID) |
||
Description |
Swap between spacing given in SAMLight unit or percent. |
||
Entity_Name |
Type: string |
Unit: none |
|
Specify the entity to be changed |
|||
Data_ID |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlLongDataIdUseMMForSpacing |
144 |
||
Set character spacing mode to be set in [mm] or in %. |
|||
scComSAMLightClientCtrlLongDataIdUseMMforLineSpacing |
145 |
||
Set line spacing mode to be set in [mm] or in %. |
|||
Spacing_Mode |
Type: int |
Unit: none |
|
•1 = use [mm] •0 = use factor (]0...1000]; 1= normal text spacing) |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•You can use only one parameter simultaneously. |
||
C# Example: Set charcater spacing mode of entity "text1" to be set in [mm]:
int CCI_Return = cci.ScSetEntityLongData("text1", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextUseMMForSpacing, 1 ); |
|||
C# Example: Get Spacing Mode flag of entity "text1"
int SpacingType = cci.ScGetEntityLongData( "text1", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextUseMMForSpacing); |
Table 166: Spacing Mode
☒ Set ☒ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetEntityLongData(string Entity_Name, int Data_ID, int Text2D_Flags) int Text2D_Flags = ScGetEntityLongData(string Entity_Name, int Data_ID) |
||
ASCII Function |
int CCI_Return = ScCciSetEntityLongData(string Entity_Name, int Data_ID, int Text2D_Flags) int Text2D_Flags = ScCciGetEntityLongData(string Entity_Name, int Data_ID) |
||
Description |
Enable multiple checkboxes from the Text Properties dialog-window. |
||
Entity_Name |
Type: string |
Unit: none |
|
Specify the entity to be changed. |
|||
Data_ID |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlags |
9 |
||
Text2D_Flags |
Type: int |
Flag: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagMonoSpaced |
0x3 |
||
Set the Mono Spaced Flag in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagItalic |
0x10000 |
||
Set the Italic Flag. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagRadial |
0x20000 |
||
Set the Radial Flag in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagRadialAlignToCharOutline |
0x40000 |
||
Set the Radial Align to Char Flag in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagReverseOrder |
0x80000 |
||
Set the Reverse Flag in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagMirrorCharOnXAxis |
0x100000 |
||
Set the Mirror X Flag in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagMirrorCharOnYAxis |
0x200000 |
||
Set the Mirror Y Flag in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagSwapLines |
0x400000 |
||
Set the Swap Lines Flag in Text Properties dialog-window. |
|
||
scComSAMLightClientCtrlLongDataIdTextCharFlagSetToLimitLength |
0x800000 |
||
Set checkbox force length in Text2D Extended. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagSetToLimitHeight |
0x1000000 |
||
Set checkbox force height in Text2D Extended. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagSetToLimitKeepAspect |
0x2000000 |
||
Set checkbox force keep aspect in Text2D Extended. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagOrderXDown |
0x4000000 |
||
Set the third Marking order symbol in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagOrderYUp |
0x8000000 |
||
Set the second Marking order symbol in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagOrderYMainUp |
0x10000000 |
||
Set the first Marking order symbol in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagOrderBiDir |
0x20000000 |
||
Set the fourth Marking order symbol in Text Properties dialog-window. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagRadialCenterMode |
0x40000000 |
||
Sets the center checkbox for text in radial mode with the corresponding RadialCenterX or RadialCenterY. |
|||
scComSAMLightClientCtrlLongDataIdTextCharFlagMergeCharacterOutline |
0x80000000 |
||
Set the Merge Character Outline Flag. |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•To prevent incorrect operation please read chapter How to work with flags. |
||
C# Example: Enable Italic and don't change all other flags:
int Text2D_Flags = cci.ScGetEntityLongData( "Text1", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextCharFlags ); Text2D_Flags = Text2D_Flags | ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextCharFlagItalic; int CCI_Return = cci.ScSetEntityLongData( "Text1", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextCharFlags, Text2D_Flags ); |
|||
C# Example: Disable Italic and don't change all other flags:
int Text2D_Flags = cci.ScGetEntityLongData( "Text1", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextCharFlags ); Text2D_Flags = Text2D_Flags & ~( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextCharFlagItalic; int CCI_Return = cci.ScSetEntityLongData( "Text1", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextCharFlags, Text2D_Flags ); |
Table 167: Text2D Checkboxes
☒ Set ☒ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetEntityLongData(string Entity_Name, int Data_ID, int Flag) int Flag = ScGetEntityLongData(string Entity_Name, int Data_ID) |
||
ASCII Function |
int CCI_Return = ScCciSetEntityLongData(string Entity_Name, int Data_ID, int Flag) int Flag = ScCciGetEntityLongData(string Entity_Name, int Data_ID) |
||
Description |
Set or get the state of the text alignment. |
||
Entity_Name |
Type: string |
Unit: none |
|
Specify the entity to be changed. |
|||
Data_ID |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlLongDataIdTextAlignment |
2 |
||
Flag |
Type: int |
Flag: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlTextAlignmentCenter |
0x1 |
||
scComSAMLightClientCtrlTextAlignmentLeft |
0x2 |
||
scComSAMLightClientCtrlTextAlignmentRight |
0x4 |
||
scComSAMLightClientCtrlTextAlignmentTop |
0x8 |
||
scComSAMLightClientCtrlTextAlignmentBottom |
0x10 |
||
scComSAMLightClientCtrlTextAlignmentMiddle |
0x20 |
||
scComSAMLightClientCtrlTextAlignmentRadialCenter |
0x40 |
||
scComSAMLightClientCtrlTextAlignmentRadialEnd |
0x80 |
||
scComSAMLightClientCtrlTextAlignmentLineLeft |
0x100 |
||
scComSAMLightClientCtrlTextAlignmentLineRight |
0x200 |
||
scComSAMLightClientCtrlTextAlignmentLineCenter |
0x400 |
||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•You can combine the horizontal and the vertical alignments values |
||
C# Example: Set the alignment of the text for the text entity "text1" to "Alignment Right" and "Alignment Bottom":
int CCI_Return = cci.ScSetEntityLongData( "text1", ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextAlignment, ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlTextAlignmentRight | ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlTextAlignmentBottom ); |
|||
C# Example: Get text alignment: |
Table 168: Text Alignment
☒ Set ☒ Get |
|||
---|---|---|---|
DLL Function |
int CCI_Return = ScSetEntityLongData(string Entity_Name, int Data_ID, int Text_Weight) int Text_Weight = ScGetEntityLongData(string Entity_Name, int Data_ID) |
||
ASCII Function |
int CCI_Return = ScCciSetEntityLongData(string Entity_Name, int Data_ID, int Text_Weight) int Text_Weight = ScCciGetEntityLongData(string Entity_Name, int Data_ID) |
||
Description |
Modify the text weight. |
||
Entity_Name |
Type: string |
Unit: none |
|
Specify the entity to be changed |
|||
Data_ID |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlLongDataIdTextWeight |
50 |
||
Text_Weight |
Type: int |
Unit: none |
|
•100: Thin •200: ExtraLight •300: Light •400: Normal •500: Medium •600: SemiBold •700: Bold •800: ExtraBold •900: Heavy |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
•You can use only one parameter simultaneously. |
||
C# Example: Set the text weight of entity "text1" to bold:
int CCI_Return = cci.ScSetEntityLongData("text1", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdTextWeight, 700); |
Table 169: Text Weight
|
☒ 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 |
Set or get various Text2D parameters. |
||
Entity_Name |
Type: string |
Unit: none |
|
Specify the entity to be changed. |
|||
Data_ID |
Type: int |
ID: |
|
Location: ScComSAMLightClientCtrlFlags |
|||
scComSAMLightClientCtrlDoubleDataIdTextSize |
1 |
||
The parameter data contains the size of the text. |
|||
scComSAMLightClientCtrlDoubleDataIdTextCharSpacing |
2 |
||
Change the character spacing of the string. Can be set in mm or % depending on flag UseMMforSpacing. |
|||
scComSAMLightClientCtrlDoubleDataIdTextLengthLimit |
3 |
||
Change the length limit of the text object. |
|||
scComSAMLightClientCtrlDoubleDataIdTextHeightLimit |
4 |
||
Change the height limit of the text object. |
|||
scComSAMLightClientCtrlDoubleDataIdTextRadius |
5 |
||
Change the radius of a radial text. Units: [mm] |
|||
scComSAMLightClientCtrlDoubleDataIdTextStartAngle |
6 |
||
Change the start angle of a radial text. Units: [rad]. |
|||
scComSAMLightClientCtrlDoubleDataIdTextRadialCenterX |
9 |
||
Sets the center of a radial text on the x axis. The center checkbox can be enabled with ScSetEntityLongData() with the flag 'RadialCenterMode'. |
|||
scComSAMLightClientCtrlDoubleDataIdTextRadialCenterY |
10 |
||
Sets the center of a radial text on the y axis. The center checkbox can be enabled with ScSetEntityLongData() with the flag 'RadialCenterMode'. |
|||
scComSAMLightClientCtrlDoubleDataIdTextLineSpacing |
11 |
||
Change the line spacing value. Can be set in mm or % depending on flag UseMMforLineSpacing. |
|||
scComSAMLightClientCtrlDoubleDataIdTextOrientation |
36 |
||
Changes the orientation of a text. With a parameter of 0 for the data field of ScSetEntityDoubleData() the text is oriented in horizontal direction. If the parameter is pi/2 then the text is displayed vertically. |
|||
Parameter |
Type: double |
Unit: depends on constant |
|
The corresponding value. |
|||
CCI_Return |
Type: int |
||
CCI return number, see error list. |
|||
Notes |
- |
||
C# Example:Set the radius to 30 mm and change the text size of the text entity "text1" to 20 mm:
// set the radius to 30 mm int CCI_Return_01 = cci.ScSetEntityDoubleData("text1", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdTextRadius, 30.0);
// change the font size int CCI_Return_02 = cci.ScSetEntityDoubleData("text1", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdTextSize, 20.0); |
Table 170: Various Text Parameters