|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter ITK二次开发源码分享: 替换命名引用name reference- E2 V0 l) D" B2 }1 x2 F- W7 c
; ?% }: A2 ]( [9 ^. u& m$ ^) r
) k. W3 N% e$ y! z' F- #include <ae/dataset.h>, U4 t \; @& h ?! r0 z+ o
- #include <sa/TCfile.h>1 _: j+ c5 k$ T) K# A; ?; L# [
- #include <tccore/aom.h>! @: q: U# _) E( M9 M
- #include <sa/tcfile_cache.h>
% Q% w, s' n: j- W7 t
+ S; u& o( P, G; f- static void
9 p1 c- o" W: a" Q2 N - (tag_t dataset_tag, tag_t old_file,' r: ^' I5 y6 x: @. e
- char *new_file_path, char *ref_name)
4 L. ^2 n. Q$ Y5 N& J - {- ]5 {& o9 B4 T* j% a6 {
- IMF_file_data_p_t file_data;
, z7 a) o1 Y" ~! C& e$ z0 Q - IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));* b" j6 s$ [+ F+ v( B# U% M
- 2 s. p( W4 t% A+ c
- tag_t new_file_tag = NULLTAG;9 q% P" d& ~" P# ~/ w5 R; j) U
- IFERR_REPORT(AOM_lock(old_file));
( C5 u! R0 w% X' w1 Q& x. l - IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,
2 t: i& q1 o: _" {6 @0 s9 ~ - FALSE, &new_file_tag)); & r/ r1 G8 ], d/ d4 k
& X- E& p2 A: Y6 j5 L- IFERR_REPORT(AOM_lock(dataset_tag));! G0 L) A4 O. N) i) T
- IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,
4 ~2 \. _" R# i, r - AE_PART_OF, new_file_tag));5 F0 i; y# D2 g/ \' X2 t/ @# P
- ( [- ]! c% H4 G# ~
- IFERR_REPORT(AE_save_myself(dataset_tag));
$ r6 ?. l6 {8 x6 P+ Y# `) ?3 M - IFERR_REPORT(AOM_unlock(dataset_tag));
' i6 P1 \2 q) X5 R - IFERR_REPORT(IMF_release_file_access (&file_data));
- A9 e( ~% g( T
$ o! L; n0 L/ F* |9 W8 q: c, o- /* assuming the old file should be deleted */
6 ^. m! z% j; ~ - IFERR_REPORT(AOM_lock_for_delete(old_file));7 l1 o1 Q m) S8 T8 J
- IFERR_REPORT(AOM_delete(old_file));
0 j- d3 T" c6 t6 i& `4 A - }
复制代码 5 V% ?7 ]9 d3 H m( S/ S
9 w3 ], N5 ^! S0 M" d8 R4 K+ d N9 A0 x
|
|