Home
Reply
Regular Contributor
xpz
Posts: 46

how to import a STEP or IGES file

I am newbie for 3D Interoperability, I want to convert a STEP file to a SAT file, but not output after conversion, following is my code,

 

#include "SPAIConverter.h"
#include "SPAIDocument.h"
#include "SPAIResult.h"


void Convert()
{
 SPAIDocument src("c:/head.stp");
 SPAIDocument dst("c:/head.sat");
 SPAIConverter converter;
 converter.Convert(src, dst);
}

 

Attached is the STEP file, I download it from forum.

 

I also try to convert a ACIS BLOCK to IGES file, fail again, following is the code,

 

#include "SPAIAcisDocument.h"
#include "SPAIConverter.h"
#include "SPAIDocument.h"
 
void Convert()
{
 BODY *block1=NULL;
 api_solid_block( SPAposition(0,0,0), SPAposition(50,50,50),block1 );

 ENTITY_LIST ipAcisEntities;
 ipAcisEntities.add( block1 );
 SPAIAcisDocument src( &ipAcisEntities );
 SPAIDocument dst( "C:\\model.igs" );
 SPAIConverter converter;
 converter.Convert(src, dst);
}

 

Can you tell me what is wrong for the code.

 

I use R19 sp3,

link with:

 

SPAXBase.lib
SPAXInterop.lib
SPAXAssemblyRep.lib
xcore2k.lib
SPAXDefaultGeometryRep.lib
SPAXGeneric.lib
xmil.lib
SPAXAcisBase.lib

 

run with:

 

icudt38.dll

icuuc38.dll

SPAXAcisBase.dll

SPAXAcisKernel.dll

SPAXBase.dll

SPAXInterop.dll

 

Do I need to unlock 3D Interoperability as unlock modeler?

 

Thanks in advance.

 

 

Spatial Moderator
ybiyani
Posts: 222

Re: how to import a STEP or IGES file

Yes. You need to unlock all the products in order to use them. Please see if that solves this issue.

Spatial Moderator
ybiyani
Posts: 222

Re: how to import a STEP or IGES file

Also I recommend that you review the samples shipped with the product (shipped in \samples folder).

Regular Contributor
xpz
Posts: 46

Re: how to import a STEP or IGES file

I get the license file and unlock the interop, then I compile the "simple_vc8.sln" in the sample folder.

 

When I try to convert the "head.stp" to IGES file, it reports there is "No Entity to Translate".

 

I type "simple -i head.stp -o head.igs" in my testing, attached is the program output. Can you tell me why this happend?

 

Thanks very much.

Spatial Moderator
ybiyani
Posts: 222

Re: how to import a STEP or IGES file

Hello xpz,

 

You are trying to convert from STEP to IGES which is unsupported. Please try converting from STEP to SAT to IGES and let us know what you find.

 

Regards,

Yogesh

Regular Contributor
xpz
Posts: 46

Re: how to import a STEP or IGES file

It works now, thank you very much.