Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating the exporting of mesh data from an Analysis file using VBA

Status
Not open for further replies.

wchasemason

Newbie
Sep 24, 2024
1
I am developing a process 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:
Code:
    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.
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor