11-16-2010 11:54 PM - edited 11-16-2010 11:55 PM
i'm a rookie of ACIS. Learning from a book i try the code below to save a entity in a sat file,but i find the created .sat file is 0KB.Nothing in it!
i am puzzled by this problem.
Look forward to your support.
void save_ent(char* filename,ENTITY* ent)
FILE *fp = fopen(filename,"w");
ENTITY_LIST* savelist = new ENTITY_LIST;
printf("can not open it\n");
11-17-2010 12:22 AM - edited 11-17-2010 12:22 AM
Are you calling unlock before saving?
Can you check if pris is created, by checking outcome of api_make_prism.( or check its not null, initialize it with null first)
11-17-2010 07:49 PM
Can you check the result of api_make_prism and api_save_entity_list and see if they are ok?
Something like outcome result = api_make_prism(..)
if ( !result.ok() )
printf("make prism failed");
11-18-2010 06:41 PM
I have tried your solution,and the result showed that the prism had been made up successfully.
I think there must be some error else in the program that makes the failed of the produceing.
11-19-2010 12:34 PM
You were correct about the need to call api_unlock_license(). Modeling operations will succeed without doing so, I believe, but definitely not save or restore.