2018-01-3009:18 AM - last edited on 2023-07-1208:36 PM by Doreena Deng
Hello, I am a new Addon developer for Archicad 21. I know how to create one and make it work (with Visual Studio 2015). Today, I'd like to build one which allow me to scan every walls on a building plan, get their information (length, height...), get the connected walls information (position of the connection, angle...) and the roof information in order to generate Achicad objects (created by me) on an other plan according to this information. I dont understand very well English even if I understand fairly well the structures/unions of the documentation. I read it but I don't manage to use it properly to do what I want to do. Can anybody help me to build my project ? Regards.
To scan every wall on a building plan, you can use the ACAPI_Element_GetElemList function, using API_WallID as its typeID parameter. You will get a GS::Array of API_Guid-s, corresponding to the placed walls.
Using the GUIDs, you can get information about the elements, using the ACAPI_Element_Get with an API_Element object, with the given GUID in its header. In the API_Element's wall member, you are able to get the height of the wall, and calculate its length using its beginning and end coordinates.
To get connection data about a wall, you'll have to use the ACAPI_Element_GetRelations function with an API_WallRelation object given as its relData parameter. Note that you'll have to call ACAPI_DisposeWallRelationHdls after you don't need the data any more, to prevent memory leaks.
Information about Roof elements can be retrieved in a similar manner, using the ACAPI_Element_GetElemList (with API_RoofID) and ACAPI_Element_Get functions.