In ExchangeSharp.I want to export A3DAsmProductOccurrence or A3DAsmPartDefinition to file instead of A3DAsmFileModel

this is my code but it doesn’t work.

            A3DAsmModelFileData modelFileData; // will contain node data
            API.Initialize(out modelFileData);
            API.A3DAsmModelFileGet(model_file, ref modelFileData);
            var model_file_data = new A3DAsmModelFileWrapper(model_file);
            int indent = 0;
            Write(GetName(model_file), indent++);
            for (int idx = 0; idx < model_file_data.m_uiPOccurrencesSize; ++idx)
                var intPtrPo = Marshal.ReadIntPtr(model_file_data.m_ppPOccurrences, idx * Marshal.SizeOf(typeof(IntPtr)));
                A3DAsmProductOccurrenceData poData;
                API.Initialize(out poData);
                var ss = API.A3DAsmProductOccurrenceGet(intPtrPo, ref poData);
                A3DAsmModelFileData productFileData;
                API.Initialize(out productFileData);
                productFileData.m_ppPOccurrences = intPtrPo;
                productFileData.m_uiPOccurrencesSize = 1;
                productFileData.m_dUnit = 1;
                productFileData.m_eModellerType = poData.m_eModellerType;
                IntPtr intPtrPoOut;
                API.A3DAsmModelFileCreate(ref productFileData, out intPtrPoOut);
                A3DRWParamsExportFbxData k;
                API.Initialize(out k);
                var write_status1 = API.A3DAsmModelFileExportToFbxFile(intPtrPo, ref k, output_file);
                //RecursivelyPrintName(po, indent, model_file);

i have write base on this link:

have exception in

Exporting a single Product Occurrence (PO) and Part Definition to a file instead of the entire model is possible. The export functions all take in an A3DAsmModelFile pointer, so you still need to pass in this PRC entity. After importing your model, I recommend creating a new empty A3DAsmModelFile with A3DAsmModelFileCreate. You must create and populate an A3DAsmModelFileData structure that you pass upon creation, which contains an array of Product Occurrences. You can populate this array with the PO of interest from the original loaded model, but this does require you to traverse the PRC of the loaded model and locate the PO you would like to export. Once you have created the AsmModelFile entity and populated its child POs in the structure, you can pass this new A3DAsmModelFIle* entity into the appropriate Export function (i.e. A3DAsmModelFileExportToStepFile or similar).