|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
5 H% n. s: s J7 l) u8 pTeamcenter 二次开发源码分享:替换数据集dataset的引用集
; g9 k3 \5 @9 r
. h2 s$ }0 Q9 s# w$ v s3 L
$ Q" {6 Y j8 [& ?0 l$ g#include <ae/dataset.h>; S/ f! b; j& s' C: A( ^) K1 O3 h
#include <sa/TCfile.h>& x; {: K9 ?6 \" m, j
#include <tccore/aom.h>- s7 r- k) b" [" J2 X* |
#include <sa/tcfile_cache.h>
+ b: k: Q) [: ]- K$ H- C# ]7 s9 o7 h1 R
static void replace_dataset_named_reference(tag_t dataset_tag, tag_t old_file,
4 F! h" f) r# |- s% }2 O char *new_file_path, char *ref_name)4 v6 p& D9 u. l5 x
{
; X4 c$ ~" H1 p+ W& t2 {/ K IMF_file_data_p_t file_data;
3 |9 B2 k" l2 \2 M# a IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));
8 b5 Y3 s8 \, C( v5 b0 A. k
6 D3 x5 Q: m' q0 N1 }* x! \* ]- P tag_t new_file_tag = NULLTAG;
) T! C$ f; [. Q: I; H) Q- Z IFERR_REPORT(AOM_lock(old_file));- q' w- H3 k2 ~: a k5 Q2 w0 R
IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,
" f f! |- {# Y. ]/ I7 B5 } FALSE, &new_file_tag));
6 }$ f D. ^3 R. E' I) G$ X, c5 q4 K" i" G, E! x) R
IFERR_REPORT(AOM_lock(dataset_tag));
7 a2 L" l% D( ~1 D) W l+ l3 _/ }% w IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,
4 J5 f+ E {+ N' w AE_PART_OF, new_file_tag));
5 X l5 W9 l, T8 ?
) a/ }; @" k1 _ IFERR_REPORT(AE_save_myself(dataset_tag));8 T$ q- L9 e* F9 c6 C& Z8 t
IFERR_REPORT(AOM_unlock(dataset_tag)); V' i# w/ M6 o
IFERR_REPORT(IMF_release_file_access (&file_data));" j W) x' ?- p2 }3 `
! {$ T' W# h/ t6 d# ~ /* assuming the old file should be deleted */% F5 Z3 P# l' p; J. Q- e
IFERR_REPORT(AOM_lock_for_delete(old_file));8 U3 \. |% O4 @2 p; \
IFERR_REPORT(AOM_delete(old_file));2 h5 `5 x- x! J1 r/ r- Q9 o
}
* I" l) G1 c! I: J( ?$ o, x X, R" y9 f0 w
|
|