General Mechanical

General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

Automating MAC Matrix Export in ANSYS Workbench

TAGGED: ,

    • Thierry Bourdon
      Bbp_participant

      Hello

      I am working on correlating results with the NVH Toolkit in ANSYS Workbench 2024R2 and I aim to optimize my numerical model.
      I am using Mechanical scripting to automate the MAC matrix calculations and to set up loops for optimization. I have successfully created a program that adjusts the geometry thickness and performs the MAC calculation. However, I haven't found a way to automatically export the MAC matrix results to a CSV file without manual intervention.
      I tried using the recording feature in Mechanical scripting, but no relevant commands appeared on the record page.
      Is there any command available for exporting, or is there an alternative approach to achieve this?
      Thank you in advance

    • dlooman
      Ansys Employee

      Could you use *get,my_value,RSTMAC in a commands object to report values in the commands object Details window which could then be checked as output parameters?

    • Erik Kostson
      Ansys Employee

      Perhaps this helps:
      https://discuss.ansys.com/discussion/2755/how-to-run-functions-that-are-defined-in-an-act-extension-or-mechanical-add-on-from-a-script
      Any questions on that post them under the above post (https://discuss.ansys.com/discussion/2755/how-to-run-functions-that-are-defined-in-an-act-extension-or-mechanical-add-on-from-a-script)

    • Thierry Bourdon
      Bbp_participant

       

      Hello,

      The Get command isn’t working and is returning 0 in the output parameter. 

      I tried using the script from the link you provided and found the ‘export’ command. However, I couldn’t figure out how to set the file path for the export

      Do you have any idea how to use the ExportMAC function ?

      nvh_addon = ExtAPI.ExtensionManager.GetExtensionByName(“NVHToolkit”)
      nvh_module = nvh_addon.GetModule()
      mac_data=nvh_module.ExportMAC

       

Viewing 3 reply threads
  • You must be logged in to reply to this topic.