We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Automating MAC Matrix Export in ANSYS Workbench

TAGGED: ,

    • thierry.bourdon
      Subscriber

      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
      Subscriber

       

      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

       

      • Simfr
        Subscriber

        Hello, 

        did you find the solution?

        Thanks

    • thierry.bourdon
      Subscriber

      Hello, Yes ! 

      • Simfr
        Subscriber

        Hello, could you share with me how you do that? If possible, could you explain whether, in your optimization loop, you simply observe the MAC matrix or use it for another application? Thanks for your help

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