Skip to content

Instantly share code, notes, and snippets.

@mazurov
Last active November 5, 2017 14:03
Show Gist options
  • Save mazurov/5f5216b01941d5053848 to your computer and use it in GitHub Desktop.
Save mazurov/5f5216b01941d5053848 to your computer and use it in GitHub Desktop.
MFiles with python
# coding: utf-8
# In[20]:
from win32com.client import gencache
mfiles = gencache.EnsureModule('{B9C079AA-92DD-4FB4-A0E0-AA3198955B45}', 0, 1, 0)
# In[21]:
server = mfiles.MFilesServerApplication()
# In[22]:
server.Connect(AuthType=mfiles.constants.MFAuthTypeSpecificMFilesUser, UserName="",Password="", NetworkAddress="",Endpoint="2266")
# In[24]:
server_vaults = server.GetVaults()
for vault in server_vaults:
print(vault.Name)
# In[29]:
first = server_vaults.Item(1).LogIn()
first.GetGUID()
# In[43]:
for svault in server_vaults:
vault = svault.LogIn()
print("*" * 80)
print(svault.Name)
for cl in first.ClassOperations.GetAllObjectClasses():
print(" " * 4 + cl.Name)
for prop_id in cl.AssociatedPropertyDefs:
prop = vault.PropertyDefOperations.GetPropertyDef(prop_id.PropertyDef)
print(" " * 8 + str(prop.Name))
cd /D z:\mfiles-report
venv\Scripts\activate.bat & ipython notebook --ip=10.211.55.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment