We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

How to get only placed elements guids?

Anonymous
Not applicable
Hi guys,

I am using ACAPI_Element_GetElemList but none of the filters helps me get the guids of only the placed elements. On a new project the function gets 16 guids and if I place 2 elements then I get 18 guids. I thought this filter
ACAPI_Element_GetElemList (API_ObjectID, &elemListGuid, APIFilt_OnActLayout)
was the right one but it turned out none of them is right.

Is it possible to do what I want here?
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Anonymous
Not applicable
A little bit strange but using APIFilt_In3D I have to change the view to 3D every time I place a new element otherwise this element is not counted and returned by the function. The elements I place are 3D.

Anyway, this should do the trick because after placing the objects the user should change to 3D view in order to fix the objects position one according to another

If there is nothing I can improve for now, thanks, guys!

View solution in original post

5 REPLIES 5
Anonymous
Not applicable
n.mihaylov wrote:
was the right one but it turned out none of them is right.
It's a good filter for limiting selection to the active floor. I used it a lot with success. Never had more GUIDs.
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi,

ACAPI_Element_GetElemList returns the placed elements without any filter from the current database.
It returns 16 guids for a new project because a new project already can contain placed elements (for example elevations are coming from the template).
You can filter elements with 3D representation by using the APIFilt_In3D, this could be useful to filter out the elevations for example.

Regards,
Tibor
Anonymous
Not applicable
Tibor wrote:
returns the placed elements without any filter from the current database
Is it working like this with API_ObjectID? Shouldn't you pass Zombie type to get all types of elements in db?
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
kzaremba wrote:
Tibor wrote:
returns the placed elements without any filter from the current database
Is it working like this with API_ObjectID? Shouldn't you pass Zombie type to get all types of elements in db?
Yes, it will return elements with all types only when using API_ZombieElemID.

But the point is that if you create a new project from a template then it will already contain elements before you placed anything (it depends on your template).
Solution
Anonymous
Not applicable
A little bit strange but using APIFilt_In3D I have to change the view to 3D every time I place a new element otherwise this element is not counted and returned by the function. The elements I place are 3D.

Anyway, this should do the trick because after placing the objects the user should change to 3D view in order to fix the objects position one according to another

If there is nothing I can improve for now, thanks, guys!