We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Experimental Python add-on is available for Archicad 23

Akos Somorjai
Graphisoft
Graphisoft
Hi folks,

See the blog post on the developer site: https://archicadapi.Graphisoft.com/experimental-python-add-on-for-archicad23

Good luck!

Akos
86 REPLIES 86
poco2013
Mentor
I tried, something to throw on API_ParagraphType, but without successfully

UPD. If it helps. See attachment
UPD2. API_ParagraphType should be passed to memo
Thank You for the Listing of Text attributes. It will come in handy for future reference.

I can get a multisyle text to run. It just will not format correctly. The reason is because of the name conflict between the C++ code and Python. The conflicts are: from,& tab,run,eol which are used for two different uses. Changing those names for one or the other use will allow it to run,but because the APIObject attribute names are now different, Archicad will not recognize them. So the program does not recognize the formatting which was what I was trying to accomplish. I will have to wait until Graphisoft resolves the conflicts. I will just use the single line DrawText until then and just break up the paragraphs with multiple statements.

This does point out that that a simple wrapper from C++ code to Python will not be that easy or straight forward? I think that another Beta site needs be opened up to point out these problems. The first Beta was too short.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
poco2013
Mentor
Petar.Pejic wrote:
Edit: ListClickedElementMembers.py seams to work only for walls, it does not recognize any other elements when clicked (windows, doors, columns, roofs, slabs). Only walls. Is it just me, or others have that issue as well?
AFAIK-- Graphisoft has not YET defined a API_Object() for the elements you mentioned above.
The only element parameter structures (class) defined are: Wall, Morph, Zone,Text, & arc/circle. For which, there are also a direct "GET" function(s). Also, lacking is a Get_memo function.

At present, in my opinion, this experiment is lacking in too much functionality to be of much use or to properly evaluate and comment.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Anonymous
Not applicable
I am very disappointed to hear that. It really is not of much help if only a couple of elements could be accessed. It is understood able that graphisoft publish this experimental version, but I do not see the point of having this experiment for 2 years almost.
I would love hearing from graphisoft more often on this forum, so they can share their plans and progress on certain things. It would make me as an user more comfortable.
mr_Mikhail
Booster
Hello everybody.
Are you waiting for a beta?
Rumor has it that in February may begin.
If someone sees that the beta entry has opened, please write here.
P.S. And the I so understood easily can be miss this event.

P.P.S. Has anyone tried to link any interesting libraries? I tried Tkinter and overall the interaction was happening. Not without problems, of course. But as a matter of fact, it's cool.
I'll record a short video later
Anonymous
Not applicable
Hi,

I'm having trouble getting the plugin to be recognized.


My python:
My Archicad 23(yes, it's a trial):
My install folder: Any ideas?
mr_Mikhail
Booster
roger wrote:
Hi,

I'm having trouble getting the plugin to be recognized.
Hi, try adding the plugin via the Manager inside ArchiCAD.
Before doing this, remove the apk file from the plugin folder.
Anonymous
Not applicable
Hi, thank you for your reply. Unfortunatly, I does not help, but finding the Add-On Manager did help finding an error message.
Re-downloaded it today, did not change anything.
rav668
Participant
roger wrote:
Hi, thank you for your reply. Unfortunatly, I does not help, but finding the Add-On Manager did help finding an error message.
Re-downloaded it today, did not change anything.

current.PNG
You should try to download exact version of python (as it is in manual)

Download Python 3.7 installer for macOS: https://www.python.org/ftp/python/3.7.3/python-3.7.3-macosx10.9.pkg
Download Python 3.7 installer for Windows: https://www.python.org/ftp/python/3.7.3/python-3.7.3-amd64.exe
Best regards,
Rafał
rav668
Participant
I am wondering if there is any way to ask user for value of variable in console and return to script?
Thanks in advance,
Rafał
poco2013
Mentor
It appears that the stdin has been redirected -- may be wrong on that or not using the right code.

However, you can achieve a 'work around' by using tkinker's input dialog.

import tkinter as tk
from tkinter import simpledialog
root = tk.Tk()
root.withdraw()

user_info= simpledialog.askstring('title','Name')
print(user_info)

root.destroy()
you must manually destroy the instance as there is presently a bug in the application.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27