|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
) O3 {7 u; L% J
Teamcenter 二次开发源码分享:替换数据集dataset的引用集
5 h* y$ C) q5 y+ h
0 s$ L$ X9 r) J9 M7 a' O q
4 U) o1 z. J% j+ A8 l; S3 p#include <ae/dataset.h>
' I+ v% N7 J7 `& W& y#include <sa/TCfile.h>
% `, `5 x! i; o; d" z- p7 G#include <tccore/aom.h>( B* G8 i$ ^2 O g& n5 r: [+ y
#include <sa/tcfile_cache.h>
2 K2 P5 b( V7 d8 ?3 i' v& F2 h4 w4 w7 N9 }6 m7 }3 G3 A9 _/ h; Z
static void replace_dataset_named_reference(tag_t dataset_tag, tag_t old_file,$ U4 v1 m, _; w `1 X) s" `
char *new_file_path, char *ref_name)
, W7 I/ P8 I1 u* C: C1 p{
7 p, N0 z3 D9 r) j* t* j/ ?& t IMF_file_data_p_t file_data;$ q8 q3 }8 @1 a/ q+ z
IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));/ I9 I' M0 Z! z0 E) v* @
7 _* C' k" F v6 `* `- k" x6 w
tag_t new_file_tag = NULLTAG;# |9 }( i. t$ m0 `* x( e, C9 g8 ?
IFERR_REPORT(AOM_lock(old_file));$ U) y2 \2 T% [7 v% c& W/ D
IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,
) E" ?" _; W" T. x8 W5 M4 S. X% e FALSE, &new_file_tag));
9 ?* [' Z- O& R$ m% X( L! `
/ S3 B. c+ L# s IFERR_REPORT(AOM_lock(dataset_tag));
1 }6 g: Y- t }, O! N% P/ { S! ] IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,1 ~: c( E- z7 G
AE_PART_OF, new_file_tag));. Z( S. x' W! B. L3 L+ C: v; j
2 H) i" Y6 m- |9 l4 S$ Z IFERR_REPORT(AE_save_myself(dataset_tag));
) Z0 Y9 }: H4 @8 R IFERR_REPORT(AOM_unlock(dataset_tag));
6 Q& Q6 ^/ t) A, N/ O0 x IFERR_REPORT(IMF_release_file_access (&file_data));
/ L- f3 M; y+ _7 T b4 A4 w/ _+ H& c) g- W: X# L/ U# h: j
/* assuming the old file should be deleted */' J; N* b* m7 R! d8 \) u: {9 H( `
IFERR_REPORT(AOM_lock_for_delete(old_file));
5 `" f& \' ^# P5 O. \1 K, r9 |# c IFERR_REPORT(AOM_delete(old_file));8 W. ` l6 r. t- p* j. @7 C
}
' i: k2 }) l" F. F. \' _5 T: X4 a- q6 R, s; p: n b( F
|
|