|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter ITK二次开发源码分享: 替换命名引用name reference- {) s) w9 t8 Z) p# W n! \+ _
w- t6 b6 T) j
3 g. s3 i8 S. A0 T, U- C* V7 i6 x! I l
- #include <ae/dataset.h>
3 i/ {9 u( a3 R( u) Z - #include <sa/TCfile.h>; ]* }4 v+ }% Q% {9 T
- #include <tccore/aom.h>/ \4 L4 o- d2 k; Z: c
- #include <sa/tcfile_cache.h>) M8 q# J# Z6 |1 w% o0 ]
- 2 p7 e. E5 G3 X/ k
- static void
. a2 X# @' r- i1 J - (tag_t dataset_tag, tag_t old_file,
1 V( E8 p N5 k - char *new_file_path, char *ref_name)
: w! u3 ] |% L# d1 C6 C k - {- x' _3 |9 M. h" w/ [; W" ?( L ]
- IMF_file_data_p_t file_data;- `9 W! E7 r$ O/ c2 U3 t5 U" g
- IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));
1 D R3 q( G% w5 I7 }
& d. M& q3 r7 l- tag_t new_file_tag = NULLTAG;) k1 {; @. i3 m3 f) Q$ D# x
- IFERR_REPORT(AOM_lock(old_file));1 }3 l% O t, P
- IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,
; v6 A1 x+ X" G! Z - FALSE, &new_file_tag)); % _, }2 A9 f" x" F7 B/ `+ v
; z1 c8 E" S# ~3 G- IFERR_REPORT(AOM_lock(dataset_tag));0 X3 r6 l" K. n& w
- IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,. M; ]$ p) U1 E& a9 y" O' P" z) X
- AE_PART_OF, new_file_tag));1 k# C u- I D1 l* m( Z' M2 u8 D
- 2 D! E& ?7 I* s& N: w* U7 Q
- IFERR_REPORT(AE_save_myself(dataset_tag));0 F" p: B8 Q3 j
- IFERR_REPORT(AOM_unlock(dataset_tag));
# r5 l1 b8 H. v6 M/ j - IFERR_REPORT(IMF_release_file_access (&file_data));
2 S+ ~' Z6 i Z) e$ \ - 6 m$ C3 [' G+ G# x, ~
- /* assuming the old file should be deleted */+ f1 I' |* ^, A$ }( A- { ]
- IFERR_REPORT(AOM_lock_for_delete(old_file));
) B9 V/ v7 q! u' t) b6 D$ f5 \ - IFERR_REPORT(AOM_delete(old_file));
5 Q3 B! _: S* I; m - }
复制代码 3 B- r/ h) G2 f# x" \
& |: Y* `( r4 H4 z, D- G
0 p- C* ~8 R! \- G |
|