0

I am developing a process in CATIA v5 where I would like to automate the meshing of a part and then - and this is the part I'm stuck on - I would like to automatically export the data to a txt file. I am trying to use the function ExportData(), but I am getting a type mismatch error. Source: Microsoft VBScript runtime error, Description: Type mismatch: 'ExportData'.

Here is the section of my code that is important:

    Dim FileSys as FileSystem
    Dim FoldObj as Folder
    Dim FileName as CATBSTR
    Dim FileExt as CATBSTR

    Set FileSys = CATIA.FileSystem
    Set FoldObj = FileSys.GetFolder("C:\Users\username\Documents\configs\")
    
    FileName = "Config_"

    FileExt = "txt"

    Call ExportData(FoldObj,FileName,FileExt)

    boolParam1.Value = FileSys.FolderExists("C:\Users\username\Documents\configs\") 

The parameter that I have defined as boolParam1 is indeed changing to True, so the folder does in fact exist. I am struggling to see where a type mismatch could possibly be coming from. Just to be absolutely clear, I am attempting to automate the "Export Mesh" command in the Advanced Meshing Tools workbench, so if there is a different function I should be using please let me know. Also, I am automating it because eventually it will loop through multiple rows of a design table and mesh then save each design. We already have code to automate the meshing, it's the automated exporting that is new.

3
  • I guess the ExportData belongs to the AnalysisImage object. Have you defined/created one in the AnalysisDocument? Commented Sep 25, 2024 at 18:09
  • @Shrotter I see. It appears there are no pre-written functions for AnalysisDocuments. So I will likely have to write the Export Mesh command from scratch in VBA for what I want to accomplish? Commented Sep 25, 2024 at 18:47
  • You may look onto the example CAAAniPostProExportData.catvbs in the documentation. This may also work in the Advanced Meshing Tools Commented Sep 25, 2024 at 18:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.