Home
Reply
Contributor
Maximilien
Posts: 6

Exporting a APOINT at coordinate (0.0, 0.0, 0.0) results in a warning/error

I'm looking for a small issue when exporting a single point set at (0.0, 0.0, 0.0).

 

The SPAIConverter::Convert method returns a warning/error 16777234 (SPAX_ACIS_E_BOX_TOO_SMALL).

 

The output file is generated correcly (I've tried exporting to SAT, Catia 4 and Catia 5, STEP, ... with the same error)

 

code looks a little bit like this : The acisList ( ENTITY_LIST) contains only one APOINT ENTITY.

 

    try {
        SPAIAcisDocument src(&acisList);
        SPAIDocument dst(m_ExportedFilename.c_str());
        SPAIConverter converter;

        SPAIOptions options;
        if (m_VersionTag != "" )
        {
            // -- SaveVersion is to set an explicit version for output file format
            SPAIOptionName attributes("SaveVersion");
            SPAIValue attribValueVersion(m_VersionTag.c_str());
            SPAIResult res = options.Add(attributes, attribValueVersion);
            ASSERT(res.IsSuccess());//failed to set import option
        }

        //set source unit
        SPAIUnit systemUnit;
        m_DataList.GetSystemUnit(systemUnit);
        SPAIResult res = src.SetUnit(systemUnit);
        if (!res.IsCompleteSuccess())
        {
            //failed to set unit
            error_message = res.GetMessage();
            throw(0);//throw an exception so function will return false
        }

        //set progress callback
        res = converter.SetProgressCallback(ACISExporter::ACISProgressCallback);
        ASSERT(res.IsSuccess());//failed to set ACIS callback; this is never supposed to happen

        //set conversion options
        // -- TranslateAttributes is to convert color, names and their attribut to SAT attributs
        {
            SPAIOptionName attributes("TranslateAttributes");
            options.Add(attributes, true);
        }
        {
            SPAIOptionName translateFreePoints("TranslateFreePoints");
            options.Add(translateFreePoints, true);
        }
        {
            SPAIOptionName translateFreeCurves("TranslateFreeCurves");
            options.Add(translateFreeCurves, true);
        }
        res = converter.SetOptions(options);
        ASSERT(res.IsSuccess());


        //try to export the model
     
        res = converter.Convert(src, dst);

        if (!res.IsSuccess())
        {
            //failed to export file
            error_message = res.GetMessage();
            throw(0);//throw an exception so function will return false;
        }

        //export succeeded: be sure to return true
        success = true;
    }
    catch (...)
    {
        //a undefined exception occurred (this might happen when Interop doesn't have enough memory)
        if (error_message=="")
        {
            error_message="Undefined error";
        }
    }

 

Thanks.

 

Maximilien.

 

 

- Attached is a simple sat file with only a single point at (0.0, 0.0, 0.0)