General Mechanical

General Mechanical

How to get “Recently used files” from ACT in Workbench

    • PSiedlac123


      Is any way to get list of "Recently used files" from ACT or in Workbench scripting console, besides manually digging in %appdata%ANSYSvXXXFileManagement.XML ?

      What is my reason: Simple. My projects are located in deep path which is not shown in detail inside Workbench GUI>Files, but it is crucial for me to know what path these files are located. My paths are names of general projects, and files names have details on contents.

      my paths are e.g. D:\Project_2020\EFA\OPT\1_solve\EFA1_rod_optimisation_PDM20200322_R19.wbpj

      So i made not  an solution myself as follows.

      ## based on probably HFSS
      ## sys.version '2.7.4 (IronPython 2.7.4 ( on .NET 4.0.30319.42000 (64-bit))'

      import xml.etree.ElementTree as ET
      PATH_IN = "C:\Users\zws\AppData\RoamingAnsys\v190\UserRegFiles_2027930923\FileManagement.XML"
       import xml.etree.ElementTree as ET

      tree = ET.parse(PATH_IN)
      root = tree.getroot()

      if 1==2:
          print tree._root.tag
          print tree._root._children[0].tag
          print tree._root._children[0].keys() #
          print tree._root._children[0]._children[0]._children[0]._children[0].tag #
          print tree._root._children[0]._children[0]._children[0]._children[0]._children[0].keys() #
          print tree._root._children[0]._children[0]._children[0]._children[0]._children[0].get('Value')

      vlst_ = tree._root._children[0]._children[0]._children[0]._children[0]._children[0].get('Value')

      for i in zip(range(100),):
          print i



    • PSiedlac123

      btw. FileManagement.XML collects paths for all open files in classes of GeometryFileType, Projects, LegacyMechanicalFileType, EngineeringData, and Journal.

      I was surprised that execution of above code reruned ~70 project entries That is more than hard coded 20 ! The last 20 is visible in Workbench File menu.


    • Karthik R

      Excellent! It seems like your issue is resolved. If this is the case, could you please mark your update as 'Is Solution'. If you are still looking for an answer, please let us know here and we will be happy to help.

      Thank you.


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