Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Aaron Bourgoin
Advisor

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

AC24-7006 / USA AC25-5010 USA

Rhino 7 Mac

MacOS 11.6.5

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 10 - Visual Studio 2019; ArchiCAD 25

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 10 - Visual Studio 2019; ArchiCAD 25

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!