cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Begin your Archicad journey with our free learning path - perfect for newcomers and experienced users looking to strenghten their skills.

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

Objects to position according to coordinate list

Actually I have a list of coordinates (in a text/csv/excel file), and I have to position object elements (800 pcs) to the coordinates in the list.

I thought that a python script could do this. I tried with the excel export/import script.

But as far as I can see: with this method I can adjust almost every property, but of the object coordinates.

 

I need help to solve this issue.

I'm not addicted to the python method, any other solution would be welcomed.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
kuvbur
Advocate

You can achieve this without scripting using the SomeStuff add-on and its property-based positioning feature. Here's the workflow:

Create Objects: Place your objects in the model (initial position isn't critical).

Export Properties: Export the objects' properties to Excel.

Set Coordinates in Excel: In the spreadsheet, assign your desired X, Y, (and Z) coordinates to specific custom properties (e.g., Coord_X, Coord_Y, Coord_Z) for each object.

Import Properties: Import the modified Excel file back into Archicad to update the objects' properties.

Automatic Placement: The SomeStuff add-on will automatically position each object based on the coordinate values stored in its properties.

Example File 

Demo Video: 

Industrial Architect and Structural Design Engineer, developer of free addon for sync GDL param and properties

View solution in original post

Solution

If I understood you correctly, 

SomeStuff add-on can write property values directly into an element's ID field using its Sync_to{ID} command. 

I've updated the example file to demonstrate this specific functionality. You can download the latest version to see how Sync_to{ID} works in practice

Industrial Architect and Structural Design Engineer, developer of free addon for sync GDL param and properties

View solution in original post

13 REPLIES 13

To create elements you have two options:

  1. Use the TAPIR Add-On to enable more python commands. Check the "CreateObjects" command here: https://enzyme-apd.github.io/tapir-archicad-automation/archicad-addon/
  2. Or create an Add-On yourself (harder)

Hope that helps,

Bernd

Automating Archicad with Add-Ons, GDL-Objects & Python Archi-XT.com

Sorry, I'm not familiar with Tapir. I've heard about it, but I thought that it's some kind of rhino/grasshopper "upgrade".
I don't know whether it needs rhino, or works without it?
Do you know any beginner tutorial for tapir_without_rhino?

That's just a part of it. Don't worry! You don't need Grasshopper or Rhino for that!

Look at the Python examples in the GitHub repo, that should give you a good feel for it.

I'm not aware of any tutorials, tho. Still, with the documentation and the examples you can probably achieve already a lot.

 

Here, have this very rudimentary example on how to place one object:

import aclib

libpart = "Armchair 04 26"
coor_x = 4.0
coor_y = -3.0
x = 1.0
y = 1.0
z = 1.0

aclib.RunTapirCommand(
    'CreateObjects', {
        'objectsData': [
            {
                'libraryPartName': libpart,
                'coordinates': {'x': 0.0 + coor_x,   'y': 0.0 + coor_y,    'z': 0.0 },
                'dimensions': {'x': x,   'y': y,    'z': z },
            }
        ]
    })

 

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text

My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// Ā«Furthermore, I consider that Carth... yearly releases must be destroyedĀ»

Thanks for the advices!
But let me ask some questions:

I copied the script, named as a .py script; browsed in archicad tapir palette, run it - but nothing happened.

Is this workaround correct?

Is there a tapir console window somewhere, where you can get messages about the run of the script?

The archicad report window will provide some info.

Did you use archicad 26? If not, the script won't be able to find the object :

Armchair 04 26

You can also launch the script from visual studio code if you have only one archicad instance open.

Archicad 27 - GDL - PYTHON

"aclib" was missing!

But copied to the local folder - now it's working.

Thanks a lot!!!

I think I can use this, further on.

If you give the documentation and some examples to an AI like Claude AI, you'll have a lot of possibilities.

Archicad 27 - GDL - PYTHON
Solution
kuvbur
Advocate

You can achieve this without scripting using the SomeStuff add-on and its property-based positioning feature. Here's the workflow:

Create Objects: Place your objects in the model (initial position isn't critical).

Export Properties: Export the objects' properties to Excel.

Set Coordinates in Excel: In the spreadsheet, assign your desired X, Y, (and Z) coordinates to specific custom properties (e.g., Coord_X, Coord_Y, Coord_Z) for each object.

Import Properties: Import the modified Excel file back into Archicad to update the objects' properties.

Automatic Placement: The SomeStuff add-on will automatically position each object based on the coordinate values stored in its properties.

Example File 

Demo Video: 

Industrial Architect and Structural Design Engineer, developer of free addon for sync GDL param and properties

Dear Dmitry,

wow!!
That's almost perfect!
The only problem I encountered: when I want to set the element ID's, too (with this excel method).

I could set the Coord z parameter property.

I could set in the schedule, export the xlsx, set the desired values. But when I want to import the xlsx back, it shows the new element ID's, but there's no checkbox to update with the new values.

Do you know the solution?