|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter ITK二次开发源码分享: 替换命名引用name reference3 V, u0 @6 c/ w$ r7 Q) }
" A% Q, H% g4 B% `
4 T5 z5 \3 T/ B3 g9 e$ m- #include <ae/dataset.h>$ I1 P$ J. u" a9 t9 D
- #include <sa/TCfile.h>
2 [5 n+ {; K' ^1 v. X - #include <tccore/aom.h>$ ?' C% L J$ ]; {! n& q
- #include <sa/tcfile_cache.h>
; P# W3 c/ O0 @/ Y
0 b& d4 }2 A; {% ]- static void
5 E, c- K$ j0 I& L8 j - (tag_t dataset_tag, tag_t old_file,
* n% S2 V, E& I+ X$ @ - char *new_file_path, char *ref_name)* I. M! S2 M' t6 T3 P8 O
- {- S7 \! E" a8 l6 D
- IMF_file_data_p_t file_data;8 { U. V" n' `/ f7 c
- IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));
: F9 B& }( Z) t; A - 6 r+ ?+ F7 }3 A; N% R9 z
- tag_t new_file_tag = NULLTAG;
7 t; W& ]+ L4 |2 c! M9 _ - IFERR_REPORT(AOM_lock(old_file));# d5 j/ I( q) |% s
- IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,
. x* @5 T5 G% K& P3 R - FALSE, &new_file_tag)); 2 P# K* F1 U. y* z4 b
- 1 j/ ?0 @0 E* a' P
- IFERR_REPORT(AOM_lock(dataset_tag));
t! q6 P7 y) I3 s - IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,
4 V; w v" s! E8 o+ w/ ]# h4 r6 i1 G - AE_PART_OF, new_file_tag));- M/ W2 {. z7 h- X. x
- {5 |( ]0 S* c$ W, T- IFERR_REPORT(AE_save_myself(dataset_tag));
- c+ y% L c9 E% A. } - IFERR_REPORT(AOM_unlock(dataset_tag));* H s; A2 |! d3 {4 J0 ], C, {
- IFERR_REPORT(IMF_release_file_access (&file_data));& e, `' b" R6 k( b' W
- 1 S/ r: E" h7 W8 \0 `! \
- /* assuming the old file should be deleted */, z i& v( E* J2 ^5 D. K! |
- IFERR_REPORT(AOM_lock_for_delete(old_file));% M$ C6 |' P% w7 U" Y) g a _
- IFERR_REPORT(AOM_delete(old_file));
. b$ B$ y b6 A - }
复制代码
" Z& t2 B* X$ p9 R. r2 \: c5 t2 `: t
' A& Z- Y+ q) |7 P/ ^, X |
|