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

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

[复制链接]

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

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

admin 楼主

2020-2-8 09:29:34

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

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

x
( {  J0 m( z6 k$ h2 Z1 m2 D
Teamcenter二次开发源码分享:获取下一个Item ID的方法6 ]* B. K5 ?- V. H) s0 [- Z& F

6 L- ~8 j' z5 U" j' O* k[mw_shl_code=cpp,true]#include <iostream>
3 l' ?; J: v2 I) X9 g" z' Q) o4 H# y( w7 Y' q8 `/ T+ Z
#include <property/nr.h>5 c, D& @- C5 _$ Q
#include <TC/tc.h>
  Z3 u: m( K8 r- `) F" A#include <tc/tc_startup.h>
1 W% a/ H. w4 D7 w! r#include <tccore/item.h>
4 c! C. D8 E' t& s- d& \# \#include <tccore/tctype.h>8 _% j% h  J6 Q) U" a2 |* @( c
#include <base_utils/IFail.hxx>  T& O- a) _: _7 ^5 ]
#include <base_utils/TcResultStatus.hxx>
7 D7 \1 g  l' V* _* }  N, I! P#include <mld/logging/TcMainLogger.hxx>5 P! Q0 n& v7 ^" E/ ?) s' q
! z# o4 {& \. H/ |+ A
using namespace std;
6 t, }0 n/ h- H  fusing Teamcenter::Main::logger;
; l- u/ P( I& Z* ]7 \
/ ?  O. M- T+ x3 g4 N& Dint get_naming_rule_next_rev_id(tag_t item_tag, char **next_rev_id)1 \1 S" i# o& ~- g$ G4 s" K
{1 Z0 x2 K& T( k( u1 j+ `# g6 E  X) t
    int ifail = ITK_ok;
8 Z# J' l! F9 p6 T  I& u. R    ResultStatus stat;
9 o# N" F% _4 l    try7 J4 S3 K4 e9 a( e
    {
2 m+ P5 H1 a" B& O3 f        tag_t item_type_tag = NULLTAG;
/ ~; I/ W. Z% @6 R  v        stat = TCTYPE_ask_object_type(item_tag, &item_type_tag);
+ L" @' _9 {  l6 E$ k8 W, o7 D2 q+ R  Y
        char *item_type_name = NULL;$ }# F/ e2 p+ R3 N* m
        stat = TCTYPE_ask_name2(item_type_tag, &item_type_name);3 R7 y3 \& v/ y4 q
( c9 J+ d. ?% U6 Y  T! a
        stat = NR_next_value(item_type_name, "item_revision_id", item_tag, "", "", "", NULLTAG, "", "", next_rev_id);1 T. B  l3 C+ R: Q) k0 s
        if (item_type_name)  MEM_free(item_type_name);4 a6 B) S: d' x1 ~
    }8 M( H3 ?& ~" S- I" F! ?3 }( s
    catch (const IFail &ex)  z6 G/ p9 H! w# O3 r
    {: B, Y0 c( Z2 ]8 q: ^
        logger()->error(ex.ifail(), ex.getMessage());
' t5 v4 K- a5 q- H  [        cout << ex.getMessage() << endl;5 Y3 S7 I! J# G8 z
        cout << "error " << ex.ifail() << endl;! G1 r" e8 C* R+ Y5 \' F
    }9 I  a* J6 R8 u3 H: f
    return ITK_ok;
: F9 D5 d% L5 j- f. g6 V}[/mw_shl_code]
# x/ S$ N+ P* S/ `8 k
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了