|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter ITK二次开发源码分享: 替换命名引用name reference
2 g& d/ ~: F: Q9 a. t4 t0 l% Y
0 l# I! @' d! P; N, B9 @! F0 g; l& @
- #include <ae/dataset.h>
4 n! T" W0 @4 l/ g9 y; @ - #include <sa/TCfile.h>% {& P$ N# w2 |* ~7 b
- #include <tccore/aom.h>0 u. C5 u. d* m/ w( R1 ?* f% D
- #include <sa/tcfile_cache.h>) `/ F7 a( q4 G* ~) S
- . d) [, V# p2 v9 v
- static void
8 k2 R& \7 K% l# L - (tag_t dataset_tag, tag_t old_file,
$ |. }$ S( D( @* q" S - char *new_file_path, char *ref_name)
" D% \ D8 k4 c% g+ x - {
( _& T* E% E* M, q0 L - IMF_file_data_p_t file_data;
8 {6 G! |! j: t" _+ e) L7 v6 i2 ~' J - IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));
c5 q, v: g. [ X ` - $ Y4 c9 T1 n" k& |
- tag_t new_file_tag = NULLTAG;
$ V9 N5 J! M, D0 I+ D( v& P - IFERR_REPORT(AOM_lock(old_file));
' i" r. @6 w5 W" x# L - IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,
) h2 S A/ e& ]: B0 K( ? - FALSE, &new_file_tag)); 0 {& I4 d, B4 }4 i" b+ b7 M3 H% \
! x$ H* t& R1 Z7 K {8 O. m$ y* Y0 N- IFERR_REPORT(AOM_lock(dataset_tag));0 E8 N2 C# \$ D; S- u- o
- IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,
! u1 U$ X# }/ o - AE_PART_OF, new_file_tag));
. V; E7 Q _# f0 G6 h
" l2 r5 G3 ?1 j3 [0 X- IFERR_REPORT(AE_save_myself(dataset_tag));
3 \/ s5 _ r; R0 G$ u - IFERR_REPORT(AOM_unlock(dataset_tag));
* v% ]+ r5 H. Z( u; X7 W3 t3 [! g% j - IFERR_REPORT(IMF_release_file_access (&file_data));
0 j* o& ~* ` v' g9 \1 O' @ - + ]4 M# j' w8 y+ K
- /* assuming the old file should be deleted */5 Y" v6 _( a' n0 l% r
- IFERR_REPORT(AOM_lock_for_delete(old_file));
3 D4 g+ i) {4 { - IFERR_REPORT(AOM_delete(old_file));* t" T) o% y3 `& J$ I
- }
复制代码 ( `0 Y- N v/ y' O# f3 _: p
2 V4 g, C1 T, L( q9 w3 v3 n
) b) G/ k8 O8 a. o8 ? |
|