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

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

[复制链接]

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

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

admin 楼主

2020-2-8 09:29:34

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

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

x

+ `7 L  M; c& U3 t# e5 q* Q) `* i$ jTeamcenter二次开发源码分享:获取下一个Item ID的方法- ~2 D5 o% k) e) _" e5 k, F9 D# ?' n
( y* ~. E* m: ^8 F9 V! @
[mw_shl_code=cpp,true]#include <iostream>
: R8 T8 K2 w! q' m8 ]9 s
/ H/ e6 F9 C2 ?/ N* e2 u; ^) s#include <property/nr.h>
) t8 ]6 [- f9 o! w% a% e#include <TC/tc.h>7 w5 Q* L3 _$ U: S
#include <tc/tc_startup.h>! @7 ]! C+ p( l0 f& S, m1 z7 p& b, @
#include <tccore/item.h>
/ j' K0 X. H: ^- W6 ~6 I- a/ |#include <tccore/tctype.h>+ X! N4 {" g7 \4 l9 m) C, w9 X
#include <base_utils/IFail.hxx>
5 l2 }1 v4 R% v0 y- `#include <base_utils/TcResultStatus.hxx>8 U9 M( l/ k! i
#include <mld/logging/TcMainLogger.hxx>3 |- k! [0 Q) V

: ]: e1 V8 i8 x: D& ausing namespace std;: E$ k$ L! f8 Z
using Teamcenter::Main::logger;( L' s/ y; K- a
0 x  `& u. ?( E! T0 C  W$ |. _
int get_naming_rule_next_rev_id(tag_t item_tag, char **next_rev_id); |/ b+ A; F& q/ ^; `" t- B
{
- |0 E; F( }# k6 I2 _$ R: y! E9 \    int ifail = ITK_ok;
5 Y7 m& b  a* `6 [8 ~3 Q7 R2 I( K# \    ResultStatus stat;8 V; J8 E/ p* H3 N
    try
! g. d. F6 s# |- `7 e; J    {
; l, v3 x8 p& H0 b        tag_t item_type_tag = NULLTAG;7 o: {/ w1 g3 t( }% l4 P# o4 e
        stat = TCTYPE_ask_object_type(item_tag, &item_type_tag);
, c* q/ j6 z) k  |
3 }" i; i  ?! g1 Z        char *item_type_name = NULL;- E  O8 M$ {- O3 _/ V
        stat = TCTYPE_ask_name2(item_type_tag, &item_type_name);
, y2 l4 P1 G5 H! f1 D( z3 ]" K( a1 Q$ i& W
        stat = NR_next_value(item_type_name, "item_revision_id", item_tag, "", "", "", NULLTAG, "", "", next_rev_id);* B9 G# S7 J$ C* \3 ^7 b4 e
        if (item_type_name)  MEM_free(item_type_name);
. ?4 c* L: G7 B7 }9 d* s5 q- K    }0 w/ w  r5 U( ~- A1 c
    catch (const IFail &ex)9 ?3 R4 h5 r' e+ R) N
    {
2 E  ?* z' r$ N( R! R, {        logger()->error(ex.ifail(), ex.getMessage());
8 B! A" e: U8 M* P# |7 \6 d" p) V        cout << ex.getMessage() << endl;; |' T* R& O( E5 R+ n
        cout << "error " << ex.ifail() << endl;) [( G& ^6 w* p9 U% L  ?; A$ h
    }
% u. U6 A0 N; p7 H& z2 @6 Q    return ITK_ok;0 X3 r, C0 y& q- b' q! I
}[/mw_shl_code]1 K# x8 r6 C' c& r
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了