cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
License Delivery maintenance is expected to occur on Saturday, October 19, between 4 and 6 PM CEST. This may cause a short 60-minute outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool may not function properly. We apologize for any inconvenience.
Archicad Python API
About automating tasks in Archicad using the Python API.

running Python code externally on multiple opened Archicad files

Ady84a
Booster

Hello everyone,

 

When I have more than one Archicad file open, and I run the python code externally (not in the Python Palette inside Archicad) the code runs on the first file I opened. 

How can I run the code in another opened file? Is there a way in python API to list the opened Archicad files, so that I open my python program externally and then choose in which file the python code runs?

 

best regards

3 REPLIES 3

Question for Graphisoft:  is this due to the same bit of software design that opens a Grasshopper connection on the first AC session opened which may not be the session I want to run the Grasshopper connection in? It sounds eerily similar and both issues need to be fixed.

Think Like a Spec Writer
AC4.55 through 27 / USA AC27-5060 USA
Rhino 8 Mac
MacOS 14.6

FYI --- For two running instances of Archicad, Archicad will use separate ports,

 

Set the port for your script manually as in:

conn = ACConnection.connect( 19723 )

 

I believe ports are assigned serially from 19723 - 19744 but another application could take a port # 

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

BTW--- in the Python Palette, if you click on the info icon, it will list the port that the present instance of Archicad is using.

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27