ITK Programming for BOM_all_level_by_recursion

 

 

 

 

 

 

 

 

 

 

 

 

ITK Programming for BOM_all_level_by_recursion

#include<stdio.h>
#include<stdlib.h>
#include<tc\tc.h>
#include<tc\emh.h>
#include<sa\user.h>
#include<tccore\aom.h>
#include<tccore\aom_prop.h>
#include<tccore\workspaceobject.h>
#include<tccore\tctype.h>
#include<bom\bom.h>
#include<tccore\aom.h>

void display();
void childfun(tag_t child);

int ITK_user_main(int argc,char *argv[])
{
FILE *fp=NULL;

int ifail=0,i=0,j=0;
int count=0;
int count1=0;

char *uname=ITK_ask_cli_argument(“-u=”);
char *pass=ITK_ask_cli_argument(“-p=”);
char *grp=ITK_ask_cli_argument(“-g=”);
char *Itemid=ITK_ask_cli_argument(“-Item_ID=”);

char *error=NULL;
char *val1=NULL;
char *val=NULL;

tag_t item=NULLTAG;
tag_t *child=NULLTAG;
tag_t *child1=NULLTAG;
tag_t rev=NULLTAG;
tag_t BL=NULLTAG;
tag_t window=NULLTAG;

if(ITK_ask_cli_argument(“-h”))
{
display();
return ifail;
}
fp=TC_fopen(“C:\\Users\\Administrator\\Documents\\Visual Studio  2012\\Projects\\sss_project\\sss_project\\x64\\Debug\\logfile.log”,”w”);
TC_fprintf(fp,”\n**************************************************************”);
TC_fprintf(fp,”\n———-ITK log file———-“);
TC_fprintf(fp,”\n**************************************************************”);

if(argc==5)
{

if(uname!=NULL||pass!=NULL||grp!=NULL||Itemid!=NULL)
{
if(ITK_init_module(uname,pass,grp,Itemid)==ITK_ok)
{
printf(“\nLogin Success..!!”);
TC_fprintf(fp,”\nTEAMCENTER Login Successfull….!!!”);
ITEM_find_item(Item_ID,&item);
ITEM_ask_latest_rev(item,&rev);
if(BOM_create_window(&window)==ITK_ok)
{
printf(“\n Bom window created successfully..!!”);

if(BOM_set_window_top_line(window,item,rev,NULLTAG,&BL)==ITK_ok)
{
printf(“\n Bom window topline set successfully..!!”);
if(BOM_line_ask_all_child_lines(BL,&count,&child)==ITK_ok)
{
printf(“\nchild:%d\n”,count);
for(i=0;i<count;i++)
{
AOM_UIF_ask_value(child[i],”bl_indented_title”,&val);
printf(“\nchild=\t%s”,val);
childfun(child[i]);

}
}
}
BOM_close_window(window);
}
}
else
{
EMH_ask_error_text(ifail,&error);
printf(“\n ERROR:%s”,error);
TC_fprintf(fp,”\nError:%s”,error);

}
}
else
{
printf(“\n Please Enter uname,pass,grp,Item_ID ???”);
TC_fprintf(fp,”\n Please Enter uname,pass,grp,Item_ID???”);
}

}

else
{
printf(“\n command line argument less or more..”);
TC_fprintf(fp,”\n command line argument less or more..”);
}
return ifail;
}
void display()
{
printf(“\n -u\t —>Enter username”);
printf(“\n -p\t —>Enter password”);
printf(“\n -g\t —>Enter group”);

}

void childfun(tag_t child)
{
int count1=0,j=0;
tag_t *child1=NULLTAG;
char *val1=NULL;

if(BOM_line_ask_all_child_lines(child,&count1,&child1)==ITK_ok)
{
printf(“\n\tsubchild:%d”,count1);
for(j=0;j<count1;j++)
{
AOM_UIF_ask_value(child1[j],”bl_indented_title”,&val1);
printf(“\n\tsubchild=\t%s\n\n”,val1);
childfun(child1[j]);
}
}

}

 

Popular Teamcenter Article published


ITK Programming-Item Creation

ITK Programming-Teamcenter Login

Template for PreAction custom Exit DLL Program

Template for PreCondition custom Exit DLL Program

Template for Batch ITK Program

Basic ITK Customization Concept Part-02

Basic ITK Customization Concept Part-01

Teamcenter Customize Error Messages

User Service Mechanism in Teamcenter Customization

Explanation of ITK Login Program

POM Queries in Teamcenter

Teamcenter Workflow Handlers

Microsoft Visual Studio Project configuration for Teamcenter Unified ITK

Teamcenter Unified Customization Basics

Teamcenter Unified Data Model Concept


 


Four Easy Steps to Get Subscribed

Step1:-Enter your Email address and Hit SUBSCRIBE Button.

Step2:-Please check inbox and open the email with the subject lineConfirm your subscription for Global PLM“.

Step3:-Please click “Confirm Follow” and you got the email with the subject” Confirmed subscription to posts on Global PLM”.

Step4:-Voila, You are subscribed.Happy Learning


 

Leave a Reply

Your email address will not be published. Required fields are marked *