Choose your top Archicad wishes!

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

New Python utility Function

poco2013
Mentor

The Present Python API is quite limited in its Data Access capacity. And there have been many requests for improved functionality, I made up a AddOn to add additional capabilities via the Execute Command Handler. The Handler just adds on to Tibor's previous fine examples.

 

Added functions are:

Getelem - returns the Guid of the selected element

GetParams - returns all of the AutoText properties available for a element type. - writes to the session report

GetValue - returns any AutoText value available for a element -- Same as AutoText Label

GetProjInfo -returns the list of keys and values for the project information - writes to the report writer.

GetPoint - returns the x & y coordinates of a clicked point - available for element placement

GetSelected - returns the Guid for all elements selected in order of their selection

 

EDIT: now returns Array of -- [Guid, LayerName, Floor name, Element ID] in order to identify returned elements

 

SetProjInfo - sets a new value into any Project info property

GetProjvalue - gets the value of a project info property.

 

EDIT: added function "GetValuefromGuid": Input -- Guid & AutoText Property Name -- Returns Value

Third Release on GitHub.

 

Hopefully this will provide access for most of requests made here. If you  have an needed function/capability leave it in the comments and I'll see if it is feasible to add on.

I hope that Graphisoft will shortly incorporate all this capability natively into Python without the use of a AddOn.

If you agree that Python should be promptly expanded , you can send a message to Graphisoft by clinking on like on this post??

 

The video which demos this utility is posted on YouTube:

 

New Python Utility Functions 

 

The AddOn apx file is posted on the GitHub site listed in the Video description

 

i would be interested to hear of any applications which are freed up with the additional commands. And a note on performance. I doubt that Python will be very fast, but manual operations should not be a problem.

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
2 REPLIES 2
Ady84a
Booster

Realy great work!

Do these AddOns "based on the Execute Command Handler" work only in AC25 or also in AC24 ?

I have not tested them, but Probably not. They were compiled with the 25 version of the API development kit and generally are not backward compatible.

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27