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

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

[复制链接]

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

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

admin 楼主

2020-2-8 09:29:34

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

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

x
8 C% V3 h2 l8 c% q: M
Teamcenter二次开发源码分享:获取下一个Item ID的方法
  ]% v3 {2 ?5 ?3 E( z2 R: p/ O6 @
) w% L1 ~- I  M/ A! s3 l[mw_shl_code=cpp,true]#include <iostream>
; G$ c2 t& p% n" J
/ f  n/ o( r8 A: U+ P#include <property/nr.h>: t* k& R9 l; O7 K- t
#include <TC/tc.h>
; p" b, Z& I& _' L& h+ m+ Q#include <tc/tc_startup.h>
3 v; a5 D% S) K0 A#include <tccore/item.h>
& b) \( D" j( [#include <tccore/tctype.h>
7 I0 k! Y+ D/ C7 w4 `#include <base_utils/IFail.hxx>( O* K: Q5 S1 f$ P* l7 G, }% d
#include <base_utils/TcResultStatus.hxx>
# w& @" P% d' |2 r#include <mld/logging/TcMainLogger.hxx>, x% z7 i- T1 |! L) K) A' @4 O

! n4 L6 Z3 \- X4 T/ gusing namespace std;
" r. u% p3 e) kusing Teamcenter::Main::logger;
( L" ]8 D0 |4 I9 V% F9 {. i
$ ~4 f8 L3 a4 i* G5 D9 u- dint get_naming_rule_next_rev_id(tag_t item_tag, char **next_rev_id)
3 ^# W* D" ]; M- Y% T{
' R8 M# Y* [( R, F: @    int ifail = ITK_ok;" t; L2 M3 {. P3 d( d. C2 J
    ResultStatus stat;
7 }$ v; x: L, F' l1 {3 b+ E    try, g# P) {& A/ p
    {/ H1 R* F$ \4 }" }
        tag_t item_type_tag = NULLTAG;2 @0 d. L4 ?( v6 i" e) w
        stat = TCTYPE_ask_object_type(item_tag, &item_type_tag);
  \: e. d; ]. o8 e4 Q4 K" t
3 r" c+ x* \9 ~. b+ M        char *item_type_name = NULL;
3 {: U  ?; H6 ^3 q/ P) w( A& f        stat = TCTYPE_ask_name2(item_type_tag, &item_type_name);
- k, Q9 ?0 |' v* I5 n0 H, ?& x7 P- _& E  {6 D* Q8 J0 T7 @9 o
        stat = NR_next_value(item_type_name, "item_revision_id", item_tag, "", "", "", NULLTAG, "", "", next_rev_id);
, ^: c6 j4 J3 p$ \+ \        if (item_type_name)  MEM_free(item_type_name);, _! U+ k& a7 p9 e2 J( V5 l0 U6 g5 j
    }# Z' i" A# \1 {5 F
    catch (const IFail &ex)
9 q: s2 u$ A* r# `: q* D+ H. V    {
/ M1 t4 Z* v* V        logger()->error(ex.ifail(), ex.getMessage());
  c' J/ [  }. s, e  G# Q* ^        cout << ex.getMessage() << endl;
9 R2 x/ |; N" y( N; b* `% o3 j        cout << "error " << ex.ifail() << endl;" @' ?0 \  N2 ~* D2 d
    }/ [: R$ P% @: ~9 D# V+ g7 \
    return ITK_ok;
/ P) h4 L4 p% _1 h  z4 O}[/mw_shl_code]8 U' A6 x& w" e; r- U  A0 _7 V6 m
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了