|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter ITK二次开发源码分享: 替换命名引用name reference
" S) z: f( [- u& q' e; \2 p# e6 v: t& @/ V3 E [
# t: x& Y! T, a# p' C, v
- #include <ae/dataset.h># i! f* u5 l# d% j$ K
- #include <sa/TCfile.h>
3 ~% m& h- R4 r6 ~4 t! Q8 m - #include <tccore/aom.h>
4 k! v! a4 u+ H1 f3 D# K' R0 i - #include <sa/tcfile_cache.h>( {% ]7 K. f9 e$ A/ x* A
- + }" ^3 Q/ z2 I; H. r5 b
- static void - D' f% m( b2 P
- (tag_t dataset_tag, tag_t old_file,
8 r+ Y$ C2 `3 s! T+ e - char *new_file_path, char *ref_name)7 D `$ {. D; S U
- {
2 s- z* w1 [/ p8 y - IMF_file_data_p_t file_data;8 q% s: c) {* [! e. d
- IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));
$ h- X, w' z% Q- X - - L" B% S! B- y* a5 Q, t3 ~ T
- tag_t new_file_tag = NULLTAG;8 G6 J# Y5 n' G
- IFERR_REPORT(AOM_lock(old_file));
/ }9 \5 S' v' G# T* j4 p4 Q2 Y: B/ H - IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,
! u; U& f! \, q8 D$ R - FALSE, &new_file_tag)); % W* B& ~$ w; ^7 P
3 I2 |3 @! o- a; [) |. t. u- IFERR_REPORT(AOM_lock(dataset_tag));5 ]' I7 d1 D2 ~
- IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,
- t$ O; d: D& Y% B& K S - AE_PART_OF, new_file_tag));3 O, [5 i( s1 a' D$ B+ a
% k/ F5 G" |7 l; P0 Y- IFERR_REPORT(AE_save_myself(dataset_tag));1 w( q7 Z. E9 C/ i, _
- IFERR_REPORT(AOM_unlock(dataset_tag));) n$ G% ?# I+ c; a
- IFERR_REPORT(IMF_release_file_access (&file_data));
. ]) c8 i: a; C9 R6 ?3 ]! U. V
[! c! J+ J/ a( E2 d6 r4 P6 _- /* assuming the old file should be deleted */8 z8 A" u! o; B! y( D& i: [# _' p
- IFERR_REPORT(AOM_lock_for_delete(old_file));
8 L- b7 n0 {& J - IFERR_REPORT(AOM_delete(old_file));* p5 J$ O5 l. [- U7 A3 n! `
- }
复制代码
& s- r8 r7 X! i) [) M
j. k6 o l5 C, A9 O8 F
" m! D R" o& \" r$ U# \, g6 } |
|