|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter ITK二次开发源码分享: 替换命名引用name reference
. ?/ M" W# J) d
) O2 Y( k3 i- L( ~; C9 |/ o
% }5 Z( x* A' J- #include <ae/dataset.h>
* ]- V3 R( @" I% V9 L! b - #include <sa/TCfile.h>
1 Y! G* ?. ]7 i7 c. q - #include <tccore/aom.h>7 m& Q4 t9 Q0 R1 q1 Q+ J
- #include <sa/tcfile_cache.h>
. i1 x$ f- q" l2 h# n' R+ k
& [( H9 F# ?' ~- static void
( r- o- v( c# g C# W4 ^ - (tag_t dataset_tag, tag_t old_file,
0 O: }( z4 Z, _& C - char *new_file_path, char *ref_name)3 v7 `6 E3 k- X! h- _! f
- {4 d% I1 Z/ q+ P5 Z# a
- IMF_file_data_p_t file_data;+ D2 {! y% Z1 P& Y# Z9 b: |( y( Y
- IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));- ^3 x7 O/ |: `4 J6 e2 ]
0 B! y8 v, U( | q/ h( H; C- tag_t new_file_tag = NULLTAG;
- l( G" c1 k2 y( w/ _ - IFERR_REPORT(AOM_lock(old_file));
# {! r4 u1 H5 ]4 s - IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,- v1 S7 M Z( z8 p7 U( f
- FALSE, &new_file_tag)); 1 r9 S/ f% |2 b9 J1 n2 U8 R8 e4 N
- ' w- V) x0 D. [
- IFERR_REPORT(AOM_lock(dataset_tag));+ k7 z8 Y, m# Y
- IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,6 ^7 }7 [6 n a7 S
- AE_PART_OF, new_file_tag));
3 G+ A1 y/ A! p, x0 R X+ W - # H5 A) t4 F1 Y% e5 l& A4 I
- IFERR_REPORT(AE_save_myself(dataset_tag));
8 ^) ?* n3 h7 ]7 V$ B - IFERR_REPORT(AOM_unlock(dataset_tag));
$ N8 |8 t9 G/ ^) e- ` - IFERR_REPORT(IMF_release_file_access (&file_data));3 V) }! v- z8 c) Y% L
- / n' l. A4 n" y& I4 B2 @! y
- /* assuming the old file should be deleted */
9 s! l: b, d" v C( [: M' U - IFERR_REPORT(AOM_lock_for_delete(old_file));) M4 ]! @+ D5 ?
- IFERR_REPORT(AOM_delete(old_file));- b- Y. p, \7 O* K) s
- }
复制代码
( D+ p3 K, j$ L8 X A. n6 w6 z
. ] D: t. ^) R' R" ^7 h) x5 N0 {' g% f
|
|