- 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 api_unite
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-22-2011 06:24 PM
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\Buil
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,*g
api_solid_cylinder_cone(SPAposition(0,0,0),SPAposi
api_solid_cylinder_cone(SPAposition(0,0,20),SPApos
api_solid_cylinder_cone(SPAposition(0,15,0),SPApos
api_solid_cylinder_cone(SPAposition(15,0,0),SPApos
api_solid_cylinder_cone(SPAposition(0,-15,0),SPApo
api_solid_cylinder_cone(SPAposition(-15,0,0),SPApo
api_solid_block(SPAposition(-2,18,0),SPAposition(2
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!
Re: trouble in api_unite
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-23-2011 01:46 PM
problem solved
should be
AcisOption * ao = NULL;
res = api_unite();
Thanks for looking

