购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_DRF_ask_id_symbol_type( tag_t id_symbol_tag, UF_DRF_id_symbol_type_t * id_symbol_type) 函数说明:
鉴于ID符号标记,这个函数返回的ID符号类型。
函数参数:
第1个参数为输入:
id_symbol_tag代表参数变量,tag_t 为输入参数类型,ID符号的标签
第2个参数为输出:
id_symbol_type代表参数变量,UF_DRF_id_symbol_type_t * 为输出参数类型,ID符号类型(见uf_drf_types.h)
UF_DRF_ask_id_symbol_type函数实例代码演示:
在下面的示例中的代码查询ID符号亚型。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_assem.h>
#include <uf_defs.h>
#include <uf_drf.h>
#include <uf_obj.h>
#include <uf_object_types.h>
#include <uf_part.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
tag_t id_symbol_tag = NULL_TAG;
char error_message[133] = "";
int subtype, type;
UF_DRF_id_symbol_type_t id_symbol_type;
/* Initialize User Function. */
ifail = UF_initialize();
/* Find the tag to a drafting entity. */
ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(),
UF_drafting_entity_type,
&id_symbol_tag );
if( !ifail && id_symbol_tag )
{
ifail = UF_OBJ_ask_type_and_subtype( id_symbol_tag,
&type, &subtype );
}
if ( !ifail && type == UF_draft_id_symbol_subtype )
{
/* Retrieve the ID Symbol type. */
ifail = UF_DRF_ask_id_symbol_type( id_symbol_tag,
&id_symbol_type );
}
printf( "UF_DRF_ask_id_symbol_type sample " );
if( ifail )
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails.\nError is: %s\n", error_message );
}
else
printf( "is successful.\n" );
UF_terminate();
}
[/quote]