Creating and populating an external data in workbench using ACT

Does anyone know if we have access to the api to interact with the external data component system in Workbench? I have a large number of csv files and would like to create, populate, and attach the data automatically.

I've been looking through ExtAPI and haven't found a way to interact with the main workbench page.

Thank you all for your time

Tagged:

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 345
    25 Answers 100 Comments 25 Likes First Anniversary
    ✭✭✭✭

    This is very possible. There is a documented Workbench API, as well as recording of journal files (.wbjn), which are also just python (py) files. Simply turn on recording, do some actions in the UI, then stop the recording to view the python commands. Edit the file as needed with for loops and such.

    WB Menu: File>Scripting>Record Journal ..

    Also you can use WB Menu: Extensions>View ACT Console

    This will give you a scripting console to run scripts directly. You can also create python modules and use:

    import sys
    sys.path.append(r'My Directory Path')
    import MyModule
    MyModule.DoSomething()
    

    https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v231/en/act_cust_wb/API_CustomWorkflows_ProjectLevel.html?q=ExtAPI

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 345
    25 Answers 100 Comments 25 Likes First Anniversary
    ✭✭✭✭

    You probably want to check this out as well for the mechanical part of the workflow:

    https://discuss.ansys.com/discussion/629/how-to-modify-an-imported-load-settings-by-act

  • Nick R
    Nick R Member Posts: 12
    First Answer 5 Likes First Comment
    **

    The second link above doesn't appear to give general users permission to view it.

    The journal trick is very helpful and let me see how the code could be implemented, however I'm still wondering how to gain access to the ExtAPI when integrating this into an ACT Extension. It looks like there are at least two ExtAPI types (Ansys.ACT.Workbench.Project.ProjectExtensionAPI and the normal one I'm used to working with (Ansys.ACT.Mechanical.MechanicalExtensionAPI).

    If I was to load up an ACT extension I believe it provides the mechanical interface (not the project interface) so I'm wondering how to call the project ExtAPI so I can implement codes output by the recorded journal.