|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
Teamcenter ITK二次开发源码分享: 替换命名引用name reference9 W9 D; V$ t9 H" l$ ?8 D
# c- f/ |# r1 v. g3 y6 n+ E- X
# P2 Q7 F* j* I# O U: D- #include <ae/dataset.h>
. z9 O8 g( _( ^4 ^) f - #include <sa/TCfile.h>0 [! g- w+ L" z m* L9 ^
- #include <tccore/aom.h>& Z; B# n9 U- ]% I
- #include <sa/tcfile_cache.h>
! z2 h9 e. Z/ L8 k0 r+ M0 v
" R% s+ H' {0 f- d- static void
* b, m3 _0 q, x! ? - (tag_t dataset_tag, tag_t old_file,8 s, f" s$ g! r4 t
- char *new_file_path, char *ref_name)
) v0 \# o$ Q6 f' N - {# h3 g) u/ D/ u
- IMF_file_data_p_t file_data;
1 X) u8 J5 E `; `( n1 T5 }: I - IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));
* F& d9 G0 c% M
2 z- D$ B9 p1 P- tag_t new_file_tag = NULLTAG;
/ j! X3 E$ g; H1 k8 f' O - IFERR_REPORT(AOM_lock(old_file));7 Z) A) }. `' ?3 e2 A
- IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,# ?9 P. \8 E$ u, _
- FALSE, &new_file_tag)); ~! n2 G" z. a% Y3 M
' ?3 L3 @2 z8 [, Y6 |4 n9 K) [" K- IFERR_REPORT(AOM_lock(dataset_tag));
; q2 x/ A* Q% _ - IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,
1 T/ k7 T2 W1 M4 S - AE_PART_OF, new_file_tag));% r# z$ O- l0 F; T/ H
. P; z$ n0 P0 Q) O- IFERR_REPORT(AE_save_myself(dataset_tag));
% P# K! c. [3 M& q$ w - IFERR_REPORT(AOM_unlock(dataset_tag));1 A. |8 i1 b6 f S+ \2 q" N, w
- IFERR_REPORT(IMF_release_file_access (&file_data));0 s) G1 |& S9 A& b" ^
- 5 n0 E6 T5 a$ f# u
- /* assuming the old file should be deleted */
% S4 ]/ Q3 E4 Q$ l0 n - IFERR_REPORT(AOM_lock_for_delete(old_file));' v" t* h. |: ~, _* M
- IFERR_REPORT(AOM_delete(old_file));; U' Z3 e+ i) P, h* ~8 o
- }
复制代码 + {3 s# H" `+ v$ c# F1 a
; p9 c3 _. A9 K: l! K k
0 H' P% { @8 f% I) H |
|