Python API - Classification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-29
11:40 AM
- last edited on
2021-09-15
10:30 AM
by
Noemi Balogh
The function FindClassificationItemInSystem() takes in the system_name and the classification item as arguments, like this:
classificationItem = acu.FindClassificationItemInSystem('ARCHICAD Classification', 'Chair')
On upgrading a file from v22 or v23 to v24, the older classification system gets retained in the project along with the new one, both having the same classification system name. How to target a specific system in that case?
- Labels:
-
Automation (Python or JSON)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-29 08:34 PM
Since the classification systems in 23 & and 24 are the same, anything added in 23 will simply be merged into 24's system. You simply search for the 23 item name in system 24 which has the same system name as 23.
22 uses a different system classification system and system name , so that class system will be added into 24, in which case , you would search with the old system name?
IOW -- You have to know which version of Archicad is running and which classification systems are present.
Windows 11 - Visual Studio 2022; ArchiCAD 27
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-29 09:00 PM
If you migrate a v22 file into v23, you would find two classification systems, but both with the same name 'ARCHICAD Classification'. Attaching screenshots of the two from the same project.
So they need to be renamed to be distinctly identified by the current python API as I understand.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-29 10:39 PM
Or am I wrong? - just guessing?
Windows 11 - Visual Studio 2022; ArchiCAD 27

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-29 11:40 PM
Apparently FindClassificationSystem(str) does not take a version and only returns the the first found system with that name --- Obviously a bug.
A work around is to use acc.GetAllClassificationSystems() and the iterate though to find the name and version number you want. Then retrieve the ID (guid) with return[?].classificationSystemId.guid.
Windows 11 - Visual Studio 2022; ArchiCAD 27
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-30 08:50 AM
poco2013 wrote:Yes, that's one way.
A work around is to use acc.GetAllClassificationSystems() and the iterate though to find the name and version number you want. Then retrieve the ID (guid) with return[?].classificationSystemId.guid.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-30 02:19 PM
I've just implemented a new example script.
It shows how to handle classifications of elements and how to create own dialogs (user interface) with python scripts
Download the script from here:
See demo video here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-30 02:44 PM
Tibor wrote:Woah.. What a coincidence.. I had been working on developing the same thing !! Will check it out and post. Thanks.
Hi Guys,
I've just implemented a new example script.
It shows how to handle classifications of elements and how to create own dialogs (user interface) with python scripts😉
Download the script from here:
https://graphisoftse-my.sharepoint.com/:u:/g/personal/tlorantfy_graphisoft_com/EaOZ8nvnbF1AgtbdY0qHM...
See demo video here:https://ttprivatenew.s3.amazonaws.com/pulse/tlorantfy-graphisoft/attachments/14250096/classification...
This 'tkinter' thing is awesome and would be so useful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-31 12:11 PM
Tibor wrote:Tested the script on a couple of project files. My observations are:
Hi Guys,
I've just implemented a new example script.
It shows how to handle classifications of elements and how to create own dialogs (user interface) with python scripts😉
Download the script from here:
https://graphisoftse-my.sharepoint.com/:u:/g/personal/tlorantfy_graphisoft_com/EaOZ8nvnbF1AgtbdY0qHM...
See demo video here:https://ttprivatenew.s3.amazonaws.com/pulse/tlorantfy-graphisoft/attachments/14250096/classification...
It worked on a new AC24 project file having default AC24 (v2.0) classification and default AC22 classification imported for testing.
But when I test it a project with over 150 elements having customised v2.0 classification and customised AC22 classification (i.e., with a lot more sub-classifications in 'Walls', 'Flooring', etc.), it does not change the classification of any element.
elementsNewClassifications.extend([act.ElementClassification(elementId, act.ClassificationId(newClassificationSystemId, newci.classificationItemId)) for newci in newClassificationItems])
When FindClassificationItemInSystem() returns None, newci.classificationItemId gives the error:
AttributeError: 'NoneType' object has no attribute 'classificationItemId'This is the case when the some classification of v22 is
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2023-01-20 06:32 AM
Hi Tibor,
I am trying to access the link to the python code but get an error that says
"Sorry, you cannot access this document. Please contact the person who shared it with you."
Will you be able to grant me access to it? It will be extremely useful.
Regard
Mauricio