Create drawings from models (Creo Elements/Direct Annotation) > Advanced topics > Customization for advanced users > Text functions
  
Text functions
You can customize the following areas of Creo Elements/Direct Annotation relating to text:
The DOCU-REGISTER-TR-GROUP and -TYPE functions and options
The DOCU-REGISTER-SPECIAL-CHAR function and options
The DOCU-REGISTER-TR-GROUP and -TYPE functions and options
The DOCU-REGISTER-TR-GROUP and DOCU-REGISTER-TR-TYPE functions define groups of text reference types. Text references are particularly useful in customized frames.
Text references are defined with LISP functions in either the am_customize file or in a separate file loaded into Creo Elements/Direct Annotation. To load a file into Creo Elements/Direct Annotation, enter (load "path / filename") in the user input line, where path / filename is the file and its path containing valid text reference definitions.
You can also enter a DOCU-REGISTER-TR-GROUP or DOCU-REGISTER-TR-TYPE function in the user input line. Be sure to use unique names for new text reference groups and types. To register a new group or type with an already existing name, you must first de-register the old entity.
The text reference functions are listed below. See the individual links for information about them. An example is also given.
Syntax
DOCU-REGISTER-TR-GROUP function
DOCU-UNREGISTER-TR-GROUP function
DOCU-REGISTER-TR-TYPE function
DOCU-UNREGISTER-TR-TYPE function
DOCU-UPDATE-TR-GROUP function
DOCU-REGISTER-TR-GROUP function
The DOCU-REGISTER-TR-GROUP function registers a new group of text reference types. You must give the new group a name, which is seen in the user interface, and an update scope, which can be either GLOBAL or SHEET.
Syntax
(DOCU-REGISTER-TR-GROUP "New group name" "Group update scope")
DOCU-UNREGISTER-TR-GROUP function
The DOCU-UNREGISTER-TR-GROUP function de-registers a previously-defined text reference group. You can specify any existing group name, enclosing it within double quotes.
Syntax
(DOCU-UNREGISTER-TR-GROUP "Group name")
DOCU-REGISTER-TR-TYPE function
The DOCU-REGISTER-TR-TYPE function registers a new text reference type. You must include the following in the type definition:
The name of the group to own the new text reference type.
The unique name of the new text reference type. This name will be seen in the user interface.
The initial value of the text reference (for example, ??? or NIL).
The update function called to refresh the text reference type. Precede the function name with an apostrophe.
Syntax
(DOCU-REGISTER-TR-TYPE "Owning group name" "New text reference type name" "Initial value" 'Update function)
DOCU-UNREGISTER-TR-TYPE function
The DOCU-UNREGISTER-TR-TYPE function de-registers a previously-defined text reference type. Include the name of the group containing the type, and the name of the text reference type itself. Both names must be enclosed within double quotes.
Syntax
(DOCU-UNREGISTER-TR-TYPE "Group name" "Text reference type")
DOCU-UPDATE-TR-GROUP function
The DOCU-UPDATE-TR-GROUP function updates a defined text reference group. The group name must be enclosed within double quotes. This function can be used to update a group from a LISP program or dialog.
Syntax
(DOCU-UPDATE-TR-GROUP "Group name")
Example
The following is an example of a text reference registration:
(docu-register-tr-group "My_group_name" "GLOBAL")
(docu-register-tr-type "My_group_name" "MY_TYPE" "???" 'my-value-update-function)
The first function above creates a text reference group named "My_group_name" that has a global update scope. The second function creates a text reference type named "MY_TYPE" in the text reference group "My_group_name". The current (initial) value is "???", and updated values are supplied by "my-value-update-function".
The DOCU-REGISTER-SPECIAL-CHAR function and options
The DOCU-REGISTER-SPECIAL-CHAR function is used to register special characters for use in the Creo Elements/Direct Annotation Special Characters table. Any character from the hp_symbols and hp_symbols2 fonts can be registered. A predefined pixmap can also be included in the Special Characters table to represent the character.
The registration functions can be included in the am_customize file or in a separate file. To load a file into Creo Elements/Direct Annotation, enter (load "path / filename") in the user input line, where path / filename is the file and its path containing valid DOCU-REGISTER-SPECIAL-CHAR functions.
You can also enter a DOCU-REGISTER-SPECIAL-CHAR function in the user input line. Be sure to use unique names for the character "metaname".
The DOCU-REGISTER-SPECIAL-CHAR function, its options, and related functions are listed below. See the individual links for information about them. An example is given below.
Syntax
(DOCU-REGISTER-SPECIAL-CHAR --+--> CHAR-CODE option-------->+--->
| ^
|--> FONT-CODE option-------->|
| |
|--> META-NAME option-------->|
| |
`--> PIXMAP-FILE option------>'
DOCU-UNREGISTER-SPECIAL-CHAR-ALL function
DOCU-UNREGISTER-SPECIAL-CHAR function
CHAR-CODE option
:CHAR-CODE specifies the code number of the special character in the selected font (:hp_symbols or :hp_symbols2).
Syntax
-->(:CHAR-CODE)----->|code number|------->
FONT-CODE option
:FONT-CODE specifies the font containing the special character to be registered. The font possibilities are :hp_symbols and :hp_symbols2.
Syntax
-->(:FONT-CODE)----->|:hp_symbols or :hp_symbols2|------->
META-NAME option
:META-NAME specifies the name by which the special character is to be known in the Special Characters table and in the Text Editor. The name must be unique; de-register a previous instance of a metaname to register it again. The metaname is displayed between angle brackets, for example, <Diameter>.
Syntax
-->(:META-NAME)----->|"metaname"|------->
PIXMAP-FILE option
:PIXMAP-FILE specifies a pixmap or bitmap file to include in the special character's entry in the Special Characters table. The file can be produced in any standard pixmap editor, such as XPaint. The recommended size for a pixmap is 42 by 24 pixels.
Syntax
-->(:PIXMAP-FILE)----->|"filename"|------->
DOCU-UNREGISTER-SPECIAL-CHAR-ALL function
The DOCU-UNREGISTER-SPECIAL-CHAR-ALL function de-registers all previously defined special characters. In the am_customize file (or in a separate file), use this function before instances of DOCU-REGISTER-SPECIAL-CHAR if you do not want the default characters to be available.
DOCU-UNREGISTER-SPECIAL-CHAR function
The DOCU-UNREGISTER-SPECIAL-CHAR function de-registers a previously-defined special character. You can specify any existing character metaname, enclosing it within double quotes.
Syntax
(DOCU-UNREGISTER-SPECIAL-CHAR "metaname")
Example
The following is an example of a special character registration:
(docu-register-special-char :char-code 126
:font-code :hp_symbols2
:meta-name "Micro"
:pixmap-file "pixmaps/doc3d2d/sym2_126.pm")