- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
trouble in making a block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-28-2011 04:58 PM
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);}
}
Re: trouble in making a block
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-29-2011 05:06 AM - last edited on 07-29-2011 05:08 AM
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
Re: trouble in making a block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-29-2011 02:51 PM
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);}
}
Re: trouble in making a block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-01-2011 02:03 AM
Did you check if your unlocking succeeded?
spa_unlock_products(..).get_state() == SPA_UNLOCK_PASS
See this example.
AR
Re: trouble in making a block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-01-2011 11:24 AM
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....
Re: trouble in making a block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-01-2011 02:37 AM
The key you used is not accurate. The key of acis R18 can not use in acisR21. The situation I have encountered before.

