Choose your top Archicad wishes!

Read more
Archicad Python API
About automating tasks in Archicad using the Python API.

Automatic file conversion




We are setting up a file conversion service and would like to support Archicad file format. 
I would like to set up a service that opens a .dwg file and saves it as .pln. Preferably, I would call Archicad from the command line with the input and output files as arguments. However, if it is possible to start Archicad with a script, from command line, that opens and re-saves a file it would also be a viable option.
As I have not been able to find an existing solution to the issue, I have been looking at the documentation, and examples, for scripting AC with python. 
It seems straight forward to 
1. open a connection
2. open a file
3. save the file  
However, when running the script from VS code, as suggested in the article, I am unable to connect without specifying a port number to connect to



from Archicad import ACConnection

# create connection
conn = ACConnection.connect()
assert conn

acc = conn.commands
act = conn.types
acu = conn.utilities

# open file 




python "C:\temp\"
Traceback (most recent call last):
  File "C:\temp\", line 10, in <module>
    conn = ACConnection.connect()
TypeError: connect() missing 1 required positional argument: 'port'




Furthermore, when running it from the 'Python palette' inside AC it does not find the open file command from

Is there a way to adjust the script to work from command line, and add the saving of the file?
Thank you in advance