Cancel
Showing results for 
Search instead for 
Did you mean: 

ITK : How to revise Item Revision, using ITK

Valued Contributor
Valued Contributor

Hi, thank you for reading this post.

I am learning ITK, so I am so beginner.

 

So I tray to create program to revice the Item Revision. 

But I have no idea about which function I should use. 

 

Could you tell me how to write programs to revise Item?

 

Also, now I am writing program to create BOM structure.

The following is the code.  But I failed to create BOM structure. 

 

/* Create child */
retcode = PS_create_bom_view(NULLTAG, view_name, view_desc, item2, &bom_view2);
retcode = AOM_save (bom_view2); 
retcode = AOM_save (item2);

retcode = PS_create_bvr(bom_view2, revision_name, revision_desc, precise, rev2, &bvr2);
retcode = AOM_save (bvr2);
retcode = AOM_save (bom_view2);
retcode = AOM_save (rev2);


/* Create Occurrences */
retcode = PS_create_occurrences(bvr, rev2, bom_view2, n_occurrences, &occurrences); //Error
retcode = AOM_save(bvr);
retcode = AOM_save(bvr2);


if(retcode = ITK_ok){
EMH_get_error_string( NULLTAG , retcode , &msg );
printf( "Error with ITEM__ask_key_for_ItemRevision: %s\n", msg );
}
i=0;
for(i=0; i<n_occurrences ; i++){
printf("tag_occurrences = %d \n", occurrences[i]);
}

 

 

3 REPLIES

Re: ITK : How to revise Item Revision, using ITK

Valued Contributor
Valued Contributor

To Revise an Item, use these functions

ITEM_copy_rev()

ITEM_perform_deepcopy()

Re: ITK : How to revise Item Revision, using ITK

Valued Contributor
Valued Contributor

Thank you so much!!

how to create item and dataset in teamcenter using ITK

Experimenter
Experimenter

I am beginner in Teamcenter. I want to create Item and dataset, could anyone help me, how can i do this,

 

Below is my code:

 

 

#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<tc\tc.h>
#include<tc\tc_startup.h>
#include<tcinit\tcinit.h>
#include<tccore\item.h>
#include<ae\dataset.h>
#include<tccore\aom.h>
#include<tccore\aom_prop.h>
#include<stdlib.h>
#include<tccore\tctype.h>
#include<tccore\grm.h>
int ITK_user_main(int argc, char* argv[])
{

int status;
printf("\nAttemping auto login to Teamcenter");
status= ITK_auto_login();
printf("\n\nSuccessful login");

const char* item_id = "000228";
const char* item_name = "nut";
const char* item_type = "Item";
const char* rev_id = "000228/A;1-nut";
tag_t* item = NULLTAG;
tag_t* rev = NULLTAG;
tag_t aDatasetType = NULLTAG;
const char* aDatasetName = "000228/A";
const char* aDatasetDescription = "First data set";
const char* aDatasetId = NULLTAG;
const char* aDatasetRev = "000228/A;1-nut";
tag_t* aNewDataset = NULLTAG;

ITEM_create_item(item_id,item_name,item_type,rev_id,item,rev);
AE_create_dataset_with_id(aDatasetType,aDatasetName,aDatasetDescription,aDatasetId,aDatasetRev,aNewDataset);
printf("\n\nDataset successfully genrated");
ITK_exit_module(TRUE);
return status;
}