NX获取特征名称使用UF_MODL_ask_feat_name这个接口,接口说明里有一段话:
Returns a character string containing the feature type and time stamp of the feature passed into the function. The time stamp refers to the order of creation. For example, if you created two blocks they would be time stamped as BLOCK(0) and BLOCK(1).
所以在获取名称时,NX会根据时间顺序自动加上序号,就像上面所说的BLOCK(0)、BLOCK(1)等。那如果想获取无时间戳的名称怎么实现呢?NX提供了一个获取特征时间戳的接口UF_MODL_ask_time_stamp_of_feature,由此可以获取时间序号进行比对,然后从名称中将时间戳去除掉即可。代码实现如下:
1 char* strrstr(const char *dst, const char *src) 2 { 3 if ((NULL == dst) || (NULL == src)) 4 { 5 return (char*)dst; 6 } 7 8 const char *pdst = dst; 9 const char *psrc = src; 10 char *right= NULL; 11 while (*dst) 12 { 13 while (*pdst == *psrc) 14 { 15 if (*pdst== '