Choose your top Archicad wishes!

Read more
Archicad C++ API
About Archicad add-on development using the C++ API.

Materials of Profile


How can I get the materials of a profile?


I use complex profiles with columns and beams and want to get their materials but have no idea how to do that. Any suggestions or hints? Thanks in advance.

//1. You need to get a list of beam segments
ACAPI_Element_GetMemo(element.header.guid, &memo, APIMemoMask_BeamSegment)
//2. Get the profile index for the segment, if the segment is made by a profile
if (structtype == API_ProfileStructure) constrinx = memo.beamSegments[0].assemblySegmentData.profileAttr
//3. Get the profile itself
UInt64 mask = APIMemoMask_StretchedProfile;
GSErrCode err = ACAPI_Element_GetMemo(elemhead.guid, &memo, mask);
ProfileVectorImage profileDescription = *memo.stretchedProfile;
//4. Go through the hatches in ProfileVectorImage and get the index of the materials

ConstProfileVectorImageIterator profileDescriptionIt(profileDescription);
while (!profileDescriptionIt.IsEOI()) {
    switch (profileDescriptionIt->item_Typ) {
    case SyHatch:
        const HatchObject& syHatch = profileDescriptionIt;
        Geometry::MultiPolygon2D result;
        if (syHatch.ToPolygon2D(result, HatchObject::VertexAndEdgeData::Omit) == NoError) {
            for (UInt32 i = 0; i < result.GetSize(); i++) {
                API_AttributeIndex	constrinxL = ACAPI_CreateAttributeIndex((GS::Int32)syHatch.GetBuildMatIdx().ToGSAttributeIndex());

Structural engineer, developer of free addon for sync GDL param and properties

Thanks a lot, that helped me.

I made it myself up to the 4th point but didn't know I have to use VectorImage. And actually I used ACAPI_Attribute_GetDefExt() not the memo. Attribute_Test example has the correct code. Thanks again!