Basic Python file for RAM DataAccess API


Applies To:     
  Product(s): RAM Structural System
  Version(s): Any
  Area:  General; Import/Export

 

 

 

 

 

 

Below is the basic Python code for a project using RAM DataAccess. An image of the development console and the plain text are included. This would be the main.py file.

import win32com.client as win32
 
try:
# Create an instance of RAMDataAccess
    DataAccess = win32.Dispatch("RAMDataAccess.RamDataAccess1.1")
 
    # Get IDBIO1 interface and then call the GetIniFilePath() method
    # looking at RAMDataAccess.tlh we see that IDBIO1_INT = 10
    dbio = DataAccess.GetInterfacePointerByEnum(10)
 
    # use it..., lets try the GetIniFilePath() method
    iniPath = dbio.GetIniFilePath()
   
    # print it
    print(f"Ini path: {iniPath}")
 
except Exception as e:
    print(f"Error: {e}")
 
# Clean up COM object
del DataAccess


See Also


What is RAM DataAccess? [TN]