Home
Reply
Regular Contributor
bheld
Posts: 41

Troubles exporting solid bodies as IGES after switching from api_xiges_write

In switching from R17 to R20 we had to move away from api_xiges_write for obvious reasons.  Now when we run an export for solids such as those created by api_solid_block, using this code:

 

    SPAIFile logFile("C:\\log.txt");
    SPAIAcisDocument src(&exportlist);
    SPAIDocument dst(strFileName);
    SPAIConverter converter;

    SPAIUnit srcUnit(SPAIUnitMeter);
    src.SetUnit(srcUnit);
    dst.SetUnit(srcUnit);

    converter.StartLog(logFile);
    converter.Convert(src, dst);
    converter.StopLog(logFile);

 

we get this in the log file.  The exportlist has entities in it.  Any ideas?

 

 

--------------------------------------------------------------------------------
Translator Name    : Spatial InterOp Connect ( Version : 20 0 1)
System Name        : Windows_NT
Machine Name       : BHELD-DT
User Name          : bheld
Source System      : ACIS
Destination System : IGES
Output File        : D:\temp\foo3.igs
Start Time         : Thu Sep 24 13:48:01 2009

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Source Document Preprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Target Document Preprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Start BRep
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
BRep Source Representation Preprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
BRep Source Representation Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
BRep Target Representation Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
End BRep
------------------------Representation Conversion Summary-----------------------
No. of Acorn Bodies                       :    0
No. of Solid Bodies                       :    0
No. of Wire Bodies                        :    0
No. of Sheet Bodies                       :    0
--------------------------------------------------------------------------------
BRep Conversion Result : Partial Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Start DocumentFeature
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
DocumentFeature Source Representation Preprocessing Result : No Entity to Translate
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
DocumentFeature Source Representation Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
DocumentFeature Target Representation Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
End DocumentFeature
------------------------Representation Conversion Summary-----------------------
No. of Groups                             :    0
--------------------------------------------------------------------------------
DocumentFeature Conversion Result : No Entity to Translate
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Target Document Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Target Document Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------Document Conversion Summary--------------------------
No. of Items of DocumentFeature Representation :    0
No. of Items of BRep Representation            :    0
--------------------------------------------------------------------------------
Output File "D:\temp\foo3.igs" Writing has Failed with code2
--------------------------------------------------------------------------------
Finish Time : Thu Sep 24 13:48:01 2009

--------------------------------------------------------------------------------
Translation Result : Partial Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

Spatial Moderator
ybiyani
Posts: 223

Re: Troubles exporting solid bodies as IGES after switching from api_xiges_write

Looks like you have set up the code correctly (nothing jumps out right away.).

 

Have you unlocked the products?

 

What is the behavior with the sample application (see AcisExport.cpp included in \samples\connectacis)?

 

Can you try to modify the implementation to get the error codes so that you get more info as you progress?

 

Any other information you thing we should know?

 

I suggest that you start with the sample application ....

Regular Contributor
bheld
Posts: 41

Re: Troubles exporting solid bodies as IGES after switching from api_xiges_write

Looks like you have set up the code correctly (nothing jumps out right away.).

 

Have you unlocked the products?  Yes. I can import IGES files in this app without any trouble.

 

What is the behavior with the sample application (see AcisExport.cpp included in \samples\connectacis)?  I haven't tried this yet.

 

Can you try to modify the implementation to get the error codes so that you get more info as you progress? Will do.

 

Any other information you thing we should know?  Not that I can think of.

 

 

Do I need to set any options to export solids as surfaces or something?

Spatial Employee
RTadlock
Posts: 40

Re: Troubles exporting solid bodies as IGES after switching from api_xiges_write

Is there any way you could share the code the creates the export list?

Regular Contributor
bheld
Posts: 41

Re: Troubles exporting solid bodies as IGES after switching from api_xiges_write

I'll try to post a complete example early next week.  Thanks for the pointers.

Regular Contributor
bheld
Posts: 41

Re: Troubles exporting solid bodies as IGES after switching from api_xiges_write

No luck.  Here's the code and the output.  I guess I'll try the examples next unless someone can comment first.  I don't think I need to initialize ACIS any differently, right.  This code is below too.

 

    ENTITY_LIST exportlist;

    BODY* pEntity;
    api_solid_block(SPAposition(0,0,0), SPAposition(1,1,1), pEntity);
    exportlist.add(pEntity);

    SPAIFile logFile("C:\\log.txt");
    SPAIAcisDocument src(&exportlist);
    SPAIDocument dst(strFileName);
    SPAIConverter converter;

    SPAIUnit srcUnit(SPAIUnitMeter);
    src.SetUnit(srcUnit);
    dst.SetUnit(srcUnit);

    converter.StartLog(logFile);
    converter.Convert(src, dst);
    converter.StopLog(logFile);

 

 

// How we init ACIS nowdays:

    BOOL retval;
    base_configuration* base_config = new base_configuration();
    base_config->enable_audit_leaks = FALSE;
    base_config->enable_audit_logs = FALSE;
    initialize_base(base_config);
    delete base_config;

    unlock_spatial_products_2790();

    retval = api_start_modeller(0).ok();

    if (!retval) return false;

    api_set_int_option("delete_forward_states", TRUE);
    api_set_int_option("approx_eval", FALSE); // added to resolve poor facetization on moro's problem (2/27/06)
   
    api_logging(FALSE);
    set_logging(FALSE);

 

 

 

 

--------------------------------------------------------------------------------
Translator Name    : Spatial InterOp Connect ( Version : 20 0 1)
System Name        : Windows_NT
Machine Name       : BHELD-DT
User Name          : bheld
Source System      : ACIS
Destination System : IGES
Output File        : D:\temp\foo\foo5.igs
Start Time         : Tue Sep 29 08:43:50 2009

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Source Document Preprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Target Document Preprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Start BRep
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
BRep Source Representation Preprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
BRep Source Representation Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
BRep Target Representation Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
End BRep
------------------------Representation Conversion Summary-----------------------
No. of Acorn Bodies                       :    0
No. of Solid Bodies                       :    0
No. of Wire Bodies                        :    0
No. of Sheet Bodies                       :    0
--------------------------------------------------------------------------------
BRep Conversion Result : Partial Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Start DocumentFeature
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
DocumentFeature Source Representation Preprocessing Result : No Entity to Translate
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
DocumentFeature Source Representation Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
DocumentFeature Target Representation Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
End DocumentFeature
------------------------Representation Conversion Summary-----------------------
No. of Groups                             :    0
--------------------------------------------------------------------------------
DocumentFeature Conversion Result : No Entity to Translate
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Target Document Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Target Document Postprocessing Result : Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------Document Conversion Summary--------------------------
No. of Items of DocumentFeature Representation :    0
No. of Items of BRep Representation            :    0
--------------------------------------------------------------------------------
Output File "D:\temp\foo\foo5.igs" Writing has Failed with code2
--------------------------------------------------------------------------------
Finish Time : Tue Sep 29 08:43:50 2009

--------------------------------------------------------------------------------
Translation Result : Partial Success
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

Spatial Moderator
ybiyani
Posts: 223

Re: Troubles exporting solid bodies as IGES after switching from api_xiges_write

Couple of comments on the ACIS initalize

1) set_logging(FALSE); - Please do not use this function as it renders the API BEGIN/END call useless and there is your error recovery mechanism.

2) api_logging(FALSE);- Can u try to comment this out and see if removing this helps? It should not matter but in all our tests we keep the default which is TRUE.

 

Yes...trying to reproduce the issue in the sample is definitely a good idea...

Regular Contributor
bheld
Posts: 41

Re: Troubles exporting solid bodies as IGES after switching from api_xiges_write

set_logging(FALSE) was causing the problem.  We will remove this call.

 

Thanks!