You can use the kernelAccess module to access the kernel mdb and session objects from the GUI. In addition to querying attributes of these kernel objects, you can call their methods and obtain any return values as if you were executing the code in the kernel. For example,
from kernelAccess import mdb, session partNames = mdb.models['Model-1'].parts.keys() odbNames = session.odbs.keys() v = mdb.models['Model-1'].parts['Part-1'].getVolume()
This procedure involves GUI-kernel communication via the IPC mechanism, so it is not recommended for use where performance is a concern. In other words, you should only use this procedure for accessing data or calling methods that do not take a “long time” to execute. If performance does become a problem, you can access the mdb and session objects from the abaqusGui module instead of the kernelAccess module.
Although you can import the kernelAccess module in a script that is executed before the application startup script has completed, you cannot query the mdb and session objects until the application startup script has completed. In other words, you can import the kernelAccess module in your scripts in code that is executed during the initial construction of the GUI; however, you should not attempt to access either the mdb or session object until it is needed because of some user interaction in the GUI. For more information, see “Startup script,” Section 11.2