Home
Reply
Regular Contributor
yadongshen
Posts: 44

trouble in making a block

First of all, my acis works fine in my computer. I tried a "hello_world" app in acis and it worked.

 

Then when i tried to create a easy block by calling api_make_cuboid function

 

However, when the code stepped in res = api_make_cuboid(100,50,200,block), the block is not succesfully created. The error message "Error Making Block" appeared every time i ran the code. Plz see the attachment.

 

My code is actually copied from a book: 3D modeling with ACIS written by Jonathan Corney. So i guess nothing should be wrong in it.

 

The code is :

 

#include <stdio.h>

#include "stdafx.h"

#include "acis.hxx"

#include "api.hxx"

#include "kernapi.hxx"

#include "cstrapi.hxx"

#include "body.hxx"

#include "debug.hxx"

 

void main()

{

 

outcome res = api_start_modeller(0);

if(!res.ok()){ printf("Error Starting Modeller\n"); exit(1);}

 

res = api_initialize_constructors();//Initializes constructor library

if(!res.ok()){printf("Error in api_initialize_constructors\n");exit(1);}

 

BODY* block;

 

res = api_make_cuboid(100,50,200,block);

if(!res.ok()){printf("Error Making Block\n");exit(1);}

 

FILE *output = fopen("ball.dbg","w");

debug_size((ENTITY*)ball,output);

fclose(output);

 

res = api_terminate_constructors();

if(!res.ok()){printf("Error in api_terminate_constructors\n"); exit(1);}

 

res = api_stop_modeller();

if(!res.ok()){printf("Error Stopping Modeller\n");exit(1);}

 

}

block.jpg
AR
Contributor
AR
Posts: 23

Re: trouble in making a block

[ Edited ]

It could be because you did not unlock spatial license. You need to make call to unlock_spatial_products_<NNN>(); using your license key.

See examples on this.

 

 

AR

 

Regular Contributor
yadongshen
Posts: 44

Re: trouble in making a block

HI,

 

I called the license function: unlock_spatial_products_4207();

but i was still stuck in the error making block.

 

#include <stdio.h>

#include "stdafx.h"

#include "acis.hxx"

#include "api.hxx"

#include "kernapi.hxx"

#include "cstrapi.hxx"

#include "body.hxx"

#include "debug.hxx"

 

// Declaration of the ACIS licensing function.

void unlock_spatial_products_4207();

 

void main()

{

 

unlock_spatial_products_4207();

 

outcome res = api_start_modeller(0);

if(!res.ok()){ printf("Error Starting Modeller\n"); exit(1);}

 

res = api_initialize_constructors();//Initializes constructor library

if(!res.ok()){printf("Error in api_initialize_constructors\n");exit(1);}

 

BODY* block;

 

res = api_make_cuboid(100,50,200,block);

if(!res.ok()){printf("Error Making Block\n");exit(1);}

 

FILE *output = fopen("ball.dbg","w");

debug_size((ENTITY*)ball,output);

fclose(output);

 

res = api_terminate_constructors();

if(!res.ok()){printf("Error in api_terminate_constructors\n"); exit(1);}

 

res = api_stop_modeller();

if(!res.ok()){printf("Error Stopping Modeller\n");exit(1);}

 

}

 

error making block.jpg
AR
Contributor
AR
Posts: 23

Re: trouble in making a block

Did you check if your unlocking succeeded?

spa_unlock_products(..).get_state() == SPA_UNLOCK_PASS

 

See this example.

 

AR

Regular Contributor
yadongshen
Posts: 44

Re: trouble in making a block

thanks. i will try

 

But i am thinking if the unlock_spatial_products_4207() did not succeeded, how come my hello_world ran sucessfully

 

I copied the block code into hello_world, it still had this problem.

 

I am just confused....

Contributor
pwang8097
Posts: 18

Re: trouble in making a block

The key you used is not accurate. The key of acis R18  can not use in acisR21. The situation I have encountered before.