|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
+ g3 r( s( U, ?/ rTeamcenter 二次开发源码分享:替换数据集dataset的引用集
, \. g+ t P, \! X! C7 k
# f8 L4 l! \1 G, D, I ~4 B" [6 U- j, Y. [$ j4 _/ d2 G3 x+ v
#include <ae/dataset.h>
; F* U' i9 Y) P# | _& X# c#include <sa/TCfile.h>/ S9 c; u( d) c% k8 w* K
#include <tccore/aom.h>, |: Q0 d( @7 S' ?0 O# v' B
#include <sa/tcfile_cache.h>% @+ \; L" @+ `: R2 ^* l) G
5 R7 U5 W% _6 h; O
static void replace_dataset_named_reference(tag_t dataset_tag, tag_t old_file,
3 q% r# k. M4 {8 U7 ]* i char *new_file_path, char *ref_name), g3 L6 o0 ^' G/ z8 r
{
4 Y. N. N+ S+ p( k% U( W6 q IMF_file_data_p_t file_data;
) D& y% @; i) f( r. k. Z# Q IFERR_REPORT(IMF_get_file_access(old_file, 0, &file_data));
" K7 X5 n1 h3 {
: @% B9 P( v: ?, ^! n3 [ tag_t new_file_tag = NULLTAG;* J4 X, a' H& c( m; W/ B
IFERR_REPORT(AOM_lock(old_file));; _ }) x' F% o0 i' Y
IFERR_REPORT(IMF_replace_file_and_get_new_tag(old_file, new_file_path,
S$ ^) D" L& C- A5 Q5 q FALSE, &new_file_tag));
, f C0 N3 G7 v- c/ V$ F. [4 ~! m: x4 q8 b4 U
IFERR_REPORT(AOM_lock(dataset_tag));5 O6 F! R; Q1 J; r9 p1 t
IFERR_REPORT(AE_replace_dataset_named_ref(dataset_tag, old_file, ref_name,7 n6 V( n2 o% x p
AE_PART_OF, new_file_tag));* O' g/ P- @$ S, @8 x3 a/ T# k
6 e M' t8 O7 j* K/ S
IFERR_REPORT(AE_save_myself(dataset_tag));4 S* v0 {) u4 ^' G4 j
IFERR_REPORT(AOM_unlock(dataset_tag));8 `- B( o: Z* T4 r6 P% k
IFERR_REPORT(IMF_release_file_access (&file_data));
1 e9 i1 e2 ?) d) {- r% H& |7 F7 a7 x3 F8 d$ M
/* assuming the old file should be deleted */
3 F% @- O: Q; Q$ x' a IFERR_REPORT(AOM_lock_for_delete(old_file));
- L! G3 N" `) W0 \ IFERR_REPORT(AOM_delete(old_file));
. V1 q3 s) ^" `4 [9 d* c' v}
0 i2 H2 Q. Y' J( V; P7 L. V; c* D8 y+ e
|
|