Choose your top Archicad wishes!

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

Dynamic ID Coding of Building Elements

Patrick Sherwood
Participant

Hi,

 

Is there a way to define the ID of 3D elements (walls, slabs etc.) with some of its own properties .
eg. Wall = [Composite Name] + [Fire Rating] + [STC].

 

All of these have been defined, so would like a way to automate this rather than selecting all walls and changing manually.

 

Have tried the Element ID Manager but seems to only work to increment walls individually/or part of group and doesn't seem able to dynamically create IDs.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
poco2013
Mentor

I make a short Demo video to show a Python script to accomplish this.

Convert Element ID to new title based on three properties of the element 

 

Attach is the script. Leave a comment if you have further questions.

 

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

View solution in original post

8 REPLIES 8
poco2013
Mentor

AFAIK - This is not possible with the "built in"tools in Archicad. You could create a new property using a expression which would create the new Id, but you could not overwrite the "element ID" property which I believe is your intent.

 

There are a few alternatives.

You could export a schedule to excel. Create a macro there to overwrite the Element ID field then re import into Archicad.

 

You could create a C++ AddOn to directly overwrite the "element ID"

 

Or the easiest, most straight forward way would be to create and use  a Python script. The script would involve only a few lines of code and would offer the most control over the logic, filtering and formatting.

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

I would like to know how this python script would be written.  I am also interested in writing specific information to the elementID field.

Kind Regards,



Sebastian Monroe

Director/Architect



T: +61 3 9017 6666

www.codearchitecture.com.au

NOM ARCH VIC ARB: 17939

Archicad v26, Mac Mini INTEL 64GB, AMD Radeon Pro

Does the element id manager not do what you are after?

Solution
poco2013
Mentor

I make a short Demo video to show a Python script to accomplish this.

Convert Element ID to new title based on three properties of the element 

 

Attach is the script. Leave a comment if you have further questions.

 

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
_c_
Enthusiast

Hello Gerry, many thanks for your very useful example.

Here I attach a variant avoiding the extra modules. Also there was a missing property (we are on the German AC) causing error.

 

This might be useful to others. 

 

_c_

The video is set to private, I'd love to see it.

Jared Banks, AIA
Shoegnome Architects

Archicad Blog: www.shoegnome.com
Archicad Template: www.shoegnome.com/template/
Archicad Work Environment: www.shoegnome.com/work-environment/
Archicad Tutorial Videos: www.youtube.com/shoegnome

Try it now?

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

Thanks. It works now.

Jared Banks, AIA
Shoegnome Architects

Archicad Blog: www.shoegnome.com
Archicad Template: www.shoegnome.com/template/
Archicad Work Environment: www.shoegnome.com/work-environment/
Archicad Tutorial Videos: www.youtube.com/shoegnome