2023-12-11 06:33 PM - last edited on 2024-09-26 12:08 PM by Doreena Deng
Hello everyone, I have extracted property values of elements using python API. I made some changes on both numeric and non-numeric values, and now I want to insert new modified element property values back to the elements in archicad. I would appriciate it very much if there is any advise on how to do it, if possible, using python API.
Biniyam
2023-12-12 11:25 AM
2023-12-12 03:39 PM
Thank you BerndSchwarzenbacher,
I was able to modify some properties and insert them back to the model. Is there any way to creat new element in archicad using python Api? I was wandering if i could use the extracted property values in the new element?
2023-12-12 09:08 PM
Unfortunately it's not possible to create new elements with the Python API out of the box. You'll need to employ some Add-On similar to this: https://github.com/tlorantfy/archicad-additional-json-commands This one has functions to create slabs and columns that you can use. For other elements you would need to adapt the Add-On.
2023-12-14 09:46 AM
Thank you! Does the python API has functionalies to extract dimentions of an element? or alternatively the x,y,z coordinates of a line, box or any element? The bounding boxes command is not that helpful for my purpose. Is there any logic or method in python API to extract model's geometry?
2023-12-24 10:38 AM
There are some built in properties which should give you some geometry information about elements.
You can run code like the following to see all available properties:
from archicad import ACConnection
conn = ACConnection.connect()
acc = conn.commands
propertyNames = acc.GetAllPropertyNames()
for propName in propertyNames:
print(propName)
Typically you get stuff like height offsets, thickness, length etc. But I couldn't see anything giving x,y locations.
Hope that helps