Synopsis
PDX_MSGT iges_ModifyLevels(long option, int iges_model, char **level_name, int *level_num, int num_arr_elem)
Purpose
Modify entity level numbers and/or descriptions.
Description
Use the specified level_name list of names to search all 406:3 entities in the given iges_model. If any 406:3 has a function description (fndes field) that matches a name in the level_name list, the level number (level field) contained in the 406:3 is used to find any independent entities with the same level number. The independent entity's level number is then changed to the number found in the level_num array. The 406:3's level field will also be changed to the level number found in level_num array.
Any 406:3 not referenced by the level_name array (and any associated entities) will not be affected by this function.
Due to how the 406:3 and 406:1 work together, level_num can only contain level numbers, not pointers to 406:1 entities.
Use of the IGES_INT_TO_STR option will modify/create 406:3 entities for all layers that are both in level_num and in the model. This provides the capability to map integer based level names to a string counterpart by modifying/creating 406:3s on the same level.
The following code example demonstrates a method that could be used to call iges_ModifyLevels for the purpose of mapping all independent entities on level "one" to level 11 and entities on level "two" to level 12. If this example were used, the specified model would be scanned for all 406:3 entities that have a "one" or "two" defined as a function description. If any are found, all independent entities within the same model and on the same level as the given 406:3s will be changed so that their level is mapped to either 11 or 12 respectively. This thus provides a method of mapping levels between systems relying on string based level naming conventions and integer based level conventions. .nf char *level_name[] = {"one", "two"}; int level_num[] = {11, 12}; iges_ModifyLevels ( IGES_NOOPT, model, level_name, level_num, 2); .fi
Input
option
IGES_INT_TO_STR
This option allows the modification of the function description string (fndes) in existing 406:3s or creation of new 406:3s.
iges_model
IGES model to modify.
level_name
Array of pointers which point to character strings used to match the fndes field (3rd) in any 406:3's.
level_num
.
num_arr_elem
The number of elements in level_name and
Return
IGES_NOERR