The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy, rmasaki

#302629
I'm a new ArchiCad Api developer,I want to know how get the floor information of a building model. I find that these are
element,classification concept in ArchiCad Api,but no floor or building concept.
How can I solve the problem?
Your advice/suggestoins are appreciated.
#302636
Ok, take a look at using ACAPI_Environment with APIEnv_GetStorySettingsID, e.g.:
Code: Select all
	API_StoryInfo storyInfo;
	BNZeroMemory(& storyInfo, sizeof (API_StoryInfo));
	GSErrCode err = ACAPI_Environment(APIEnv_GetStorySettingsID, &storyInfo, nullptr);
		//…get whatever you need from the story data
	BMKillHandle((GSHandle *) &storyInfo.data);
The API_StoryInfo structure will have everything you need.
#302643
Thanks.
I have several other problems。
First I can't understant the meaning of 'Database' in API, are theres several 'Database' in a project?
If I need compute the area of a building that contains many floors,should I traverse all elements of the building?e.g like
2871614.png
2871614.png (4.89 KiB) Viewed 226 times
Second,I think a building is a classification that contains many elements in ArchiCad, is the idea right?

Third,how can I construct two buiding in a project?
#302662
The ARCHICAD API doesn't really define the concept of a 'building' apart from IFC. We've had to rely on geometric methods to discover the perimeter of a building within a project and then allocate elements to buildings on the basis of containment.

The API doesn't have a formal concept of a database either, at least not in the conventional sense. A database is loosely a collection of homogenous data structures, e.g. all attributes or all elements.

Most API calls don' reference a database – the ones that do are mostly found in the documentation for ACAPI_Database, e.g. APIDb_ChangeCurrentDatabaseID (which changes the active database). Once a database is 'set', other API calls act on that database, e.g. ACAPI_Element_Get to retrieve a specific element.

The element data structure is API_Element. You can determine which floor an element belongs to by inspecting its header, header.floorInd. The details of the floor can be retrieved using the method I described above with APIEnv_GetStorySettingsID.
#302706
Ralph Wessel wrote:
Sat Oct 12, 2019 9:56 am
The ARCHICAD API doesn't really define the concept of a 'building' apart from IFC. We've had to rely on geometric methods to discover the perimeter of a building within a project and then allocate elements to buildings on the basis of containment.

The API doesn't have a formal concept of a database either, at least not in the conventional sense. A database is loosely a collection of homogenous data structures, e.g. all attributes or all elements.

Most API calls don' reference a database – the ones that do are mostly found in the documentation for ACAPI_Database, e.g. APIDb_ChangeCurrentDatabaseID (which changes the active database). Once a database is 'set', other API calls act on that database, e.g. ACAPI_Element_Get to retrieve a specific element.

The element data structure is API_Element. You can determine which floor an element belongs to by inspecting its header, header.floorInd. The details of the floor can be retrieved using the method I described above with APIEnv_GetStorySettingsID.
Thank you very much. I understand it.