I have an IDEA file from which I want to perform a simple extraction (column1 equals 6) and save this as a new file. My IDEAScript is as follows (see also attached file):
Set db = Client.OpenDatabase("myfile.IMD")
Set task = db.Extraction
dbName = "outputfile.IMD"
task.AddExtraction dbName, "", column1 == ""6"""
task.PerformTask 1, db.Count
Set task = Nothing
Set db = Nothing
However, I now want to do this from Python using win32com.client. So I tried (the os.path.join works and the file exists):
import win32com.client as win3ComClient
idea = win32ComClient.Dispatch(dispatch="Idea.IdeaClient")
db = idea.OpenDatabase(os.path.join(wd, os.path.basename(prefix)+'_myfile.IMD'))
task = db.Extraction
dbName = os.path.join(wd, os.path.basename(prefix)+'_outputfile.IMD')
task.AddExtraction(dbName, "", "Column1 == ""6""")
task = Nothing
db = Nothing
idea = None
However, this gives me the error AttributeError: 'function' object has no attribute 'IncludeAllFields' and it marks the line with task.IncludeAllFields. So where is the mistake? So it seems like I did not "translate" the IDEAScript VB properly to Python style. The function db.Extraction does not have the attribute IncludeAllFields. But in IDEAScript it does. How can I get this running? I also tried to write it in one line, so db.Extraction.IncludeAllFields but still I get an error. So I don't know how to configure the task in general using Python. This seems to be the source of the error.
Last seen: 17 hours 23 min ago
Joined: 11/04/2020 - 06:46