Inquiry about A3D_WRITE_ERROR when converting to FBX with a 60-day trial license

Hello Tech Soft 3D Support Team,

I created a class to convert CAD data to FBX format following the ImportExport sample code, but I’m encountering a “Status=A3D_WRITE_ERROR.”
I’m currently using a 60-day trial license for HOOPS Exchange.

According to the tutorial below, I tested a .CATProduct ⇒ .prc conversion with no issues:

Is there an additional authorization required for FBX output, or could there be an issue with my script?

Any guidance you can provide would be greatly appreciated.

Thank you in advance for your help.

using System;
using System.IO;
using TS3D.Exchange;
using TS3D.Exchange.Direct;

namespace HoopsConverterCSharp
{
    class CADConverterTest
    {
        static int Main(string[] args)
        {           
            if (args.Length < 2)
            {
                Console.WriteLine("Usage: HoopsConverter.exe <inputCAD> <outputFile>");
                return 1;
            }

            string inputCAD = args[0];
            string outputFile = args[1];

            try
            {             
                
                Library.Initialize("Licence", null);               
                A3DRWParamsLoadData loadParams;
                API.Initialize(out loadParams);

                IntPtr modelFile;
                var loadStatus = API.A3DAsmModelFileLoadFromFile(inputCAD, ref loadParams, out modelFile);
                if (loadStatus != A3DStatus.A3D_SUCCESS && loadStatus != A3DStatus.A3D_LOAD_MISSING_COMPONENTS)
                {
                    Console.WriteLine($"Failed to load: {inputCAD} (Status={loadStatus})");
                    return 3;
                }
               
                A3DStatus exportStatus = ExportModelFile(modelFile, outputFile);
                if (exportStatus == A3DStatus.A3D_SUCCESS)
                {
                    Console.WriteLine($"Export succeeded: {outputFile}");
                    return 0;
                }
                else
                {
                    Console.WriteLine($"Failed to export: {outputFile} (Status={exportStatus})");
                    return 4;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception: " + ex.Message);
                return 5;
            }
            finally
            {                
                Library.Free();
            }
        }

        
        static A3DStatus ExportModelFile(IntPtr modelFile, string outputFile)
        {
            string ext = Path.GetExtension(outputFile).ToLowerInvariant();

            if (ext == ".fbx")
            {
                A3DRWParamsExportFbxData fbxParams;
                API.Initialize(out fbxParams);
                return API.A3DAsmModelFileExportToFbxFile(modelFile, ref fbxParams, outputFile);
            }
            else if (ext == ".gltf" || ext == ".glb")
            {
                A3DRWParamsExportGltfData gltfParams;
                API.Initialize(out gltfParams);
                return API.A3DAsmModelFileExportToGltfFile(modelFile, ref gltfParams, outputFile);
            }
            else if (ext == ".prc")
            {
                
                A3DRWParamsExportPrcData prcParams;
                API.Initialize(out prcParams);

               
                prcParams.m_eCompressBrepType = A3DECompressBrepType.kA3DCompressionMedium;

                
                IntPtr prcWriteHelper = IntPtr.Zero;

                return API.A3DAsmModelFileExportToPrcFile(modelFile, ref prcParams, outputFile, out prcWriteHelper);
            }
            else
            {
                Console.WriteLine($"Unsupported extension: {ext}. Only .fbx, .gltf/.glb, or .prc shown here.");
                return A3DStatus.A3D_WRITE_INVALID_INPUT;
            }
        }

    }
}

Hello @k.matsunaga,
I don’t see any issue with your codes. Do you encounter the same problem when using the provided C# example? You can download this library from the Developer Zone.
It is located under Products → HOOPS Exchange → Related Technologies → HOOPS Exchange C# API.
Or it could be the CAD file issue, you can try one included in the samples to verify the codes, for example “…\samples\data\catiaV5\CV5_Aquo_Bottle_Aquo Bottle.CATProduct”.

Best Regards,
Man

1 Like