uf_layer.h (²é¿´Ô´´úÂë)
¸ÅÊö
This file contains the subroutines that offer access to the NX
database. Using the subroutines in this file, you can:
. Read the work layer
. Read the category name, member layers, and description.
. Read the layer status.
. Cycle by layer.
. Edit a category description.
. Edit a category layer.
. Edit a category name.
. Set the layer status.
. Create, read, or edit a layer category.
NX6 onwards supports creation of mixed case category names along with spaces.
Always use NX functions to determine the existence of categories with given name.
String comparison is not recommended for verifying the existence of category.
The following is the general guideline for checking for the existence of a category.
Always use the function UF_LAYER_ask_category_tag to get the tag of a category
corresponding to name. The following is an example of a function that would check
if a category has been created or not.
static tag_t ask_category_tag(char name)
{
tag_t object;
UF_CALL(UF_LAYER_ask_category_tag(name, &object));
return object;
}
A non null tag (NULL_TAG) returned from the above function indicates that the
category is present. All other category related functions such as UF_LAYER_ask_category_info,
UF_LAYER_edit_category_name, UF_LAYER_edit_category_layer, UF_LAYER_edit_category_descr can
make use of the tag obtained. The advantage of using this approach is that this function
returns the tag of a category similar to the passed name. We consider 2 names to be similar
if they pass case insensitive comparison. This way, even though a category is created using
upper case, it's existence could be still queried using mixed case strings.