Home
Reply
Regular Contributor
yadongshen
Posts: 44

trouble in api_unite

Hi, all

 

I try to unite two geometries by using api_unite(Body *, Body *, NULL)

What is the correct way to use it.

I also need to use api_substract(Body *, Body *, NULL)

 

An error reported that :

1>------ Build started: Project: block, Configuration: Debug Win32 ------

1>Compiling...

1>block.cpp

1>c:\hello_world_acis\block\block\block.cpp(50) : error C2661: 'outcome::outcome' : no overloaded function takes 3 arguments

1>Build log was saved at "file://c:\hello_world_acis\block\block\Debug\BuildLog.htm"

1>block - 1 error(s), 0 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

My original code is posted:

#include <stdio.h>

#include "stdafx.h"

#include "acis.hxx"

#include "api.hxx"

#include "kernapi.hxx"

#include "boolapi.hxx"

#include "alltop.hxx"

#include "dcl_kern.h"

#include "cstrapi.hxx"

#include "lists.hxx"

#include "body.hxx"

#include "debug.hxx"

#include "position.hxx"

#include "license.hxx"

#include "spa_unlock_result.hxx"

 

// Declaration of the ACIS licensing function.

void unlock_spatial_products_4207();

 

void

main()

{

 

outcome res = api_start_modeller(0);

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

 

unlock_spatial_products_4207();

 

res = api_initialize_constructors();

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

 

BODY *geom_a,*geom_b,*geom_c,*geom_d,*geom_e,*geom_f,*geom_g;

api_solid_cylinder_cone(SPAposition(0,0,0),SPAposition(0,0,20),20,20,20,NULL,geom_a);

api_solid_cylinder_cone(SPAposition(0,0,20),SPAposition(0,0,30),10,10,10,NULL,geom_b);

api_solid_cylinder_cone(SPAposition(0,15,0),SPAposition(0,15,20),1,1,1,NULL,geom_c);

api_solid_cylinder_cone(SPAposition(15,0,0),SPAposition(15,0,20),1,1,1,NULL,geom_d);

api_solid_cylinder_cone(SPAposition(0,-15,0),SPAposition(0,-15,20),1,1,1,NULL,geom_e);

api_solid_cylinder_cone(SPAposition(-15,0,0),SPAposition(-15,0,20),1,1,1,NULL,geom_f);

api_solid_block(SPAposition(-2,18,0),SPAposition(2,22,20),geom_g);

 

outcome res = api_unite(geom_b,geom_a,NULL);

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

 

double area = 0;

double accuracy = 0;

api_ent_area((ENTITY*)block,0.01,area,accuracy);

printf("The surface area of the cone is = %f\n",area);

getchar();

 

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);}

 

}

 

Thanks in advance!

Regular Contributor
yadongshen
Posts: 44

Re: trouble in api_unite

problem solved

 

should be

 

AcisOption *  ao = NULL;

res = api_unite();

 

Thanks for looking