I am trying to automate Maxsurf using Python. My code in Python is as follows-
import win32com.client as win32 msApp = win32.Dispatch("BentleyModeler.Application") FileName = "MonoHull.msd" msApp.Design.Open FileName,False,False
While executing, I get the following error. What is the remedy here? And why do I get the list of objects (as en excel vba) in python?
C:\Users\USER\PycharmProjects\VBA\venv\Scripts\python.exe C:/Users/USER/PycharmProjects/VBA/main.py File "C:\Users\USER\PycharmProjects\VBA\main.py", line 4 msApp.Design.Open FileName,False,False ^^^^^^^^SyntaxError: invalid syntax
Okay - thats a good sign that you have python talking to MAXSURF.
Now you need to investigate getting that filename right. I think you need the full file path ("C:\" etc). You can even try putting it into a simpler filepath to see if you're having a syntax issue with spaces or special characters.