PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

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

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

x
5 y9 u$ X. m( \
Teamcenter二次开发源码分享:获取下一个Item ID的方法  o8 x, F2 H4 L5 ~' x- O  _
! m( M$ f; L  i, T
[mw_shl_code=cpp,true]#include <iostream>
& E5 K* ~  b" E* |% o' U+ C$ P7 b2 X( n+ u1 r/ v
#include <property/nr.h>
0 f$ y2 Q: i+ T! E3 ^* r#include <TC/tc.h>. [/ Z" v( k( ]" U5 _5 @5 @
#include <tc/tc_startup.h>8 h) k. H0 K) F
#include <tccore/item.h>
( D  ]2 W& j* f1 A) H$ c' _/ b+ k8 F#include <tccore/tctype.h>3 j+ o' |* y; q  D- G
#include <base_utils/IFail.hxx>
' Z: T5 m! ?& m8 z# e/ g( q#include <base_utils/TcResultStatus.hxx>, p. v0 [6 |& f
#include <mld/logging/TcMainLogger.hxx>
, j* f5 v! D1 P+ @: v9 B( v7 y, r% l+ n
using namespace std;. u; d/ W! W9 H5 {" j
using Teamcenter::Main::logger;4 G- p8 U1 b/ }" m
/ x1 ~6 |1 l0 B1 p2 @9 A. r! H3 `0 O: q
int get_naming_rule_next_rev_id(tag_t item_tag, char **next_rev_id), M: U, J1 J; [- q/ D' i/ w4 h
{. Q& X4 R) k- g
    int ifail = ITK_ok;8 T+ r( P7 M% i
    ResultStatus stat;1 p3 S# ~. u; y# [2 G9 @
    try
6 y: w" `: Z" o6 B) H: l0 Q0 s2 [    {
, n5 A  r* V0 p6 R0 {/ e, J! S9 _        tag_t item_type_tag = NULLTAG;& X- A" l0 z  W/ J: |5 e. u, x
        stat = TCTYPE_ask_object_type(item_tag, &item_type_tag);
, ^% B1 o) J- T/ W7 E& e* S! N! v6 j! m& q6 [
        char *item_type_name = NULL;( b# {' p2 P1 |# t( j
        stat = TCTYPE_ask_name2(item_type_tag, &item_type_name);
( L0 I- z% c7 x
; S  s- {& ?: c0 J        stat = NR_next_value(item_type_name, "item_revision_id", item_tag, "", "", "", NULLTAG, "", "", next_rev_id);
  e  w0 d* j- A        if (item_type_name)  MEM_free(item_type_name);& T% v' Q0 f4 ?: T' T
    }" `% z( H  C' x3 K8 q
    catch (const IFail &ex)( ]7 w7 h8 D# b2 _* h, Z; H4 A
    {; T: i" x4 _' ]; C4 C9 m
        logger()->error(ex.ifail(), ex.getMessage());
) B3 s  p  E3 u2 W        cout << ex.getMessage() << endl;
7 Q2 j8 F; S/ K/ ~1 Q' l        cout << "error " << ex.ifail() << endl;; o; T$ |6 C" p8 R$ T
    }
3 Z  d# Z$ E) U' c, I    return ITK_ok;% d4 z( o$ e7 r* r1 Q, z
}[/mw_shl_code]
) H  \5 D8 n& t' a' t! Q
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了