|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter ITK二次开发源码分享: 替换命名引用name reference4 ?3 v, h: `7 o; W9 l
. p) ^7 t( Q- X9 I7 g1 c$ z
# L+ x7 a5 h7 {8 L4 v) P2 }7 V
- #include <ae/dataset.h>
3 R4 F G2 @$ _5 S9 {* h% y - #include <sa/TCfile.h>! e5 T4 v0 u! w: x# J+ U% c
- #include <tccore/aom.h>9 L5 y, ^- S+ D
- #include <sa/tcfile_cache.h>9 A. A# s7 o2 W$ e9 t7 N, q% {1 R
- # d2 k" x( M6 d8 q/ F% r( X/ F
- static void & v% Q6 V7 L6 b
- (tag_t dataset_tag, tag_t old_file,
) X/ m& C, a$ O, A - char *new_file_path, char *ref_name)
# ], t3 H: o8 }3 O6 ? - {
& j2 ?( E1 s8 t+ I" T - IMF_file_data_p_t file_data;! Z7 w- ]) O% t# C- w2 m9 ^5 Z9 M
- IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));
7 d) U5 L! ]$ \- k, L) @ - 4 G# P. e; l0 S, l& {
- tag_t new_file_tag = NULLTAG;
# n+ D+ b/ ~7 Q$ [# U/ y - IFERR_REPORT(AOM_lock(old_file));# L: c2 b: ^* L+ g/ G/ |
- IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,! s- ?& @4 _% u9 m& U$ P: l! K* I
- FALSE, &new_file_tag));
6 p% q; F; {% Z, b. M
* G: B, Q6 P3 ? G' g7 p- IFERR_REPORT(AOM_lock(dataset_tag));
9 p( T5 D$ H9 V# T0 H9 J$ Y - IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name," [5 r) A; ~) {$ D# ~& n+ m) k
- AE_PART_OF, new_file_tag));
" v" U3 V* O! g* n7 Q( R _7 W, R
: I- y& K2 [+ H: a% |- IFERR_REPORT(AE_save_myself(dataset_tag));2 {2 k% T: M4 u+ |0 t) z% Y
- IFERR_REPORT(AOM_unlock(dataset_tag));' H4 k$ J7 q% S6 m' P9 V) }
- IFERR_REPORT(IMF_release_file_access (&file_data));
4 T- }5 y4 R0 i, m$ R: |0 p2 y
* B) L) J9 ?* Y5 t8 Z1 U5 D. m, ?- /* assuming the old file should be deleted */
. y, X: v _( p8 [ - IFERR_REPORT(AOM_lock_for_delete(old_file));4 H1 f: P, O; L+ }. z
- IFERR_REPORT(AOM_delete(old_file));8 S) a7 S: C z- u* @% I! Y
- }
复制代码 8 k9 A/ c8 ~' X" y/ r3 w) v/ y8 C$ U, C
7 ^7 V d0 u- f1 w% I7 t2 m' n. v! ~ I# ?" K& a
|
|