PLM之家PLMHome-国产软件践行者

Teamcenter二次开发源码分享:获取下一个Item ID的方法

[复制链接]

2020-2-8 09:29:34 2210 0

admin 发表于 2020-2-8 09:29:34 |阅读模式

admin 楼主

2020-2-8 09:29:34

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
  h4 ?% J& F0 d# r3 Q
Teamcenter二次开发源码分享:获取下一个Item ID的方法
. w/ I- ?* {$ F' U' \) x# B
+ ]# e' s, ?$ W3 `/ A3 P7 D: w[mw_shl_code=cpp,true]#include <iostream>
  c8 {' k4 H5 d* ~& D6 n7 |$ S" \1 M9 L& Y8 R, ]- T4 ]9 m2 S' t
#include <property/nr.h>
" P3 ^* ~0 q( m# {4 Q#include <TC/tc.h>
6 \# ?! V& r% w# U1 W2 ?#include <tc/tc_startup.h>
4 a- n6 K) z+ q; k, R) h( r8 O$ `#include <tccore/item.h>
% Q# ^" @. y2 S, t4 l#include <tccore/tctype.h>
0 g0 {8 e+ O! P#include <base_utils/IFail.hxx>
& t/ q* X) @: K( e% J6 \#include <base_utils/TcResultStatus.hxx>$ r$ s9 X- I' x- O9 M
#include <mld/logging/TcMainLogger.hxx>
- T& {4 u: J; G9 K3 z4 G' |7 E5 J* U- \
2 o' l7 m- D, K) {8 K+ ousing namespace std;
& {# \7 C6 K3 [5 z# Susing Teamcenter::Main::logger;
; A. r! L2 V1 t* X0 k3 @$ X! V% z' }9 L: [
int get_naming_rule_next_rev_id(tag_t item_tag, char **next_rev_id)
  p1 w! G, t* v' p7 w{
- O9 d) l/ d( G& j    int ifail = ITK_ok;
' X& B; ~% \- p$ e4 h4 ~    ResultStatus stat;4 m1 H2 K: s5 u' Z* g" O- z
    try( `6 R5 X6 `' X' ]( v$ [# ?0 r
    {& C' l+ r$ G" ?; P) k
        tag_t item_type_tag = NULLTAG;
% H& _0 s, F# e        stat = TCTYPE_ask_object_type(item_tag, &item_type_tag);
4 r- H2 h5 x3 r# `
1 ~' y) u! S( e. N        char *item_type_name = NULL;
' W9 e# R. I) q0 K        stat = TCTYPE_ask_name2(item_type_tag, &item_type_name);
+ x% p+ J) R! {. d3 A) ^
) E2 i0 J& X9 T, [; a! S) r: ?        stat = NR_next_value(item_type_name, "item_revision_id", item_tag, "", "", "", NULLTAG, "", "", next_rev_id);" E7 Q/ \1 ?- P3 e; ?' g- o  a& f) I
        if (item_type_name)  MEM_free(item_type_name);1 y4 h6 b. P3 c
    }9 `% z* J3 Q$ T9 b% g
    catch (const IFail &ex)% A" \; ~9 n4 Y( j8 ?, o
    {8 c2 A; t( T) m
        logger()->error(ex.ifail(), ex.getMessage());8 ~# i) U' Q3 x3 u3 s# R8 t- d
        cout << ex.getMessage() << endl;# @. h% |5 ^7 T1 N9 d
        cout << "error " << ex.ifail() << endl;
# S1 Z5 K  B! r    }0 w; e+ @/ s# p' u: f3 N+ j1 F
    return ITK_ok;! _* L( S+ S4 ?5 t' O$ w$ R# z% c
}[/mw_shl_code]9 M6 V7 l4 k3 u- l4 i( I
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了