PLM之家PLMHome-工业软件与AI结合践行者

Teamcenter ITK二次开发源码分享:创建自定义文件夹

[复制链接]

2017-6-21 08:41:22 5932 1

admin 发表于 2015-1-21 12:57:22 |阅读模式

admin 楼主

2015-1-21 12:57:22

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
* Q3 p) I0 d9 Y  x1 W8 H6 S
2 F. t6 G0 f' W5 a" ~( F
Teamcenter ITK二次开发源码分享:创建自定义文件夹
- y; g7 A' y1 D* o' _输入的第一个参数是文件夹名称,第二个是文件夹描述。
2 N! K7 l( `9 i7 A0 j  n* S5 a; ]9 {/ H' A1 G# E6 g9 w  {: y
. ]4 r$ U  ?7 l' G
#include <TC/tc.h>
- r9 e' G1 Q9 A% P2 ]2 V7 \#include <tccore/aom.h>
7 F/ s6 T) L2 d% k* O. b#include <tc/folder.h>
& J  }  M% }, B#include <tccore/workspaceobject.h>
; H+ h. s; [2 r, S( L: T8 W4 U+ t
0 B4 ^. U/ a4 {5 }) ]5 U) L#define EXIT_FAILURE 1
8 _; Q6 e. b# ^6 B6 k$ @: o; T" E1 ?7 V: b) U( g# }
static void report_error_stack( void )
: q' l" }8 ~/ x3 W4 }' a  p1 x. Y) y {
# x6 j! ?1 [4 x+ B( `8 S+ K        int
. j* D" f4 s; I6 x0 o  `6 B! Z$ D2 s            n_errors = 0,: A+ X& ]2 Q' ^
            i = 0;
: D3 N; ?& s  e        const int
5 f- h5 S2 c) L            *severities = NULL," S# G$ ^" |2 F& t" F+ \% H+ ?
            *statuses = NULL;
9 G* l* w. p4 k* ?        const char
( `' K+ S$ I! t4 `1 N8 j5 Y; C) k            **messages;# U% y7 a, A9 P" l7 g

' d/ t- p9 A# o0 c     EMH_ask_errors( &n_errors, &severities, &statuses, &messages );
# P6 K( c6 x( R  ?# l6 Z     printf( "Error(s): \n");& F  b3 Q( T4 H% h" u+ w% h2 \5 S
     for (i = 0; i < n_errors; i++)
: c3 ~2 H' k8 U+ c% s     {
- [9 z9 |  X, T: d         printf( "    %6d: %s\n", statuses, messages );! b5 O+ a8 D" T
     }3 F1 l4 l- \+ l" L* S  [
     exit(EXIT_FAILURE);9 D$ r8 ?7 a, u' {# f+ U8 w: K
}
$ u" J) D8 B8 V* b6 k. K& W0 t& @' W' T& L4 E4 R
int ITK_user_main(int argc, char* argv[])
. q; r4 T/ D9 m* E5 m{
0 G/ _7 b, [, R7 R7 Z% k+ U    int
( z. A5 m$ j  W7 ?. l( J+ ~        status;
; P; L5 |' }. o* G' h2 m    char: V' k/ @4 l. d9 I# B
        folder_name[WSO_name_size_c+1],
/ V* @7 B. r" W4 n        fldr_desc[WSO_desc_size_c + 1]," }6 ^* g+ a! N7 V
        *message;* n$ Z8 h$ h2 O: l: b+ w( {. Q/ x* J
    tag_t
' i: P6 G2 n$ I        new_folder;
- O  M: t: |$ j# V6 T) r/ K9 k( P& m" g! Y" L
    ITK_initialize_text_services( 0 );) U$ J% }8 M1 e
    status = ITK_auto_login();8 l- [) b+ s! c6 U( I, ~
    if(status!= ITK_ok)
( I+ Y+ o  k; O7 c$ u    {# r7 U7 g( ^& J; t. M* D% c/ t
        report_error_stack();
' d/ M/ A# w3 q$ i; ?2 M2 J/ Q3 j    }* K7 M1 I  [/ Q! Y8 B
    else
' b! O7 b( L; \, A3 ^$ A1 d    {
5 L6 }. n1 b: f+ s0 ^- w        printf("iMAN login successful.\n");0 h! f5 l: y( p' a* a
    }
$ ?! S7 T% `3 d9 a) J# U& ^- h" J' c# ?" ~$ i
    ITK_set_journalling(TRUE);
; S. v3 \' _' y4 ~
0 ?; s! l  @. ~# m9 b. Z, F$ J    if (argc > 1) strcpy(folder_name, argv[1]);
! P4 e5 _5 a5 e2 z* `! l+ g, g  X& h    else1 J$ K0 W5 u' p% D) ]" t
    {2 w, _1 V) L) H$ u
        printf(" Specify the Input in Following format : \n");9 t: Y* Y* u4 ?6 u' o& Y( w
        printf("program_name folder_name  folder_description\n");/ h' x  A# ^8 h' n
        printf("E.g. create_folder phase_3 working_folder_for_phase_3_items\n");1 l& Z5 n2 p6 f) n
        return ITK_ok; 0 j7 n4 R! i3 F  t% S( K, @; ~
    }   
$ Z, X$ F! R, D& p+ H6 p2 N! \' C7 C' @! X, k# M8 l" j
    if (argc > 2) strcpy( fldr_desc, argv[2]);
! k& T5 i4 `7 I4 D( \    else strcpy( fldr_desc,"");
5 ]: `: M- G% d/ x" x3 Y' G3 e8 O+ Y& m2 z3 V5 b
    status = FL_create( folder_name, fldr_desc, &new_folder);) B$ Q$ h+ j7 y+ p
    if(status!= ITK_ok) report_error_stack(); 2 y7 k& }7 R2 [+ T$ V
( }- F" x+ I  `- b! ]' ^
    status = AOM_save(new_folder);+ w) ~) g. L: H' q6 J. H
    if(status!= ITK_ok)  report_error_stack();
. p: M/ }. K2 V5 M    else  printf("Folder '%s' Saved; ", folder_name);
# e! {. G3 [1 L+ W0 V, R8 C( p0 F6 I* A7 X5 W6 h
    status = AOM_unlock(new_folder);' c5 @! R" d! a( X) g
    if(status!= ITK_ok)  report_error_stack();
8 ?$ Q8 g8 X( e    else  printf("Unlocked; ");! A- Y; h) P7 o; \* ?5 F

7 L& I+ D  V/ {, ~    status = FL_user_update_newstuff_folder(new_folder);- [! ?5 d# J8 F# S
    if(status!= ITK_ok) report_error_stack();& x$ l5 {" ~$ k5 Q/ J. s) F
    else  printf("Put in Newstuff Folder.\n");2 \3 f/ K: ^$ e

& [8 a' g9 h- x; ]    ITK_exit_module(TRUE);% G8 s+ l& e: z8 n' T, R
    return status;0 N: `. d, U1 S
}
- m; o1 v3 J7 j% U' i- z5 A
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

全部回复1

pop227mm1 发表于 2017-6-21 08:41:22

pop227mm1 沙发

2017-6-21 08:41:22

萌新请问 这个创建了的文件夹 在哪里可以查看
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复 支持 反对

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了