Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

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

How to get all the type of label (tag) using ArchiCAD API?

Tran Thanh Lo
Booster

Hello everyone,

I am working with labels (tags) in ArchiCAD API. Now I want to get all the type of label (tag) level like the below image.

Do you know how to do that?

I am very grateful for your answer.

 

9967ea4c4b7f0a3d314410c6db291a0f.png

7 REPLIES 7
Barry Kelly
Moderator

When you say "tag" you mean "label" (I have edited your post).

 

But what do you mean by "level"?

The name of the label?

The position of the label?

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

@Barry Kelly  I want to get all the label names in the attached image list. Can you help me 


z4797559478313_dbf4e883e10acca7c7e29261b8003a43.jpg

@Linh wrote:

@Barry Kelly  I want to get all the label names in the attached image list. Can you help me 


Sorry, I can't help you as I know next to nothing about API.

I just wanted to clarify what you (or tranthanhlo - same person different log-in?) wanted.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Hi @Barry Kelly ,

I changed the title .
Looking forward to the answer.

Thank you

Hi @Tran Thanh Lo,

 

I haven't used it before, but I think this is possible with ACAPI_LibraryPart_PatternSearch().

First I would try to find the symbol label subtype and use that as an ancestor.

Best,
Bernd

Hi @BerndSchwarzenbacher ,

I did as you said but it still doesn't work. Can you look at my code below and give me advice?
Thanks in advance

API_LibPart libPart;
	libPart.typeID = APILib_LabelID;
	Int32 numFound;
	API_LibPart result[50];
	ACAPI_LibPart_PatternSearch(&libPart, "", result, &numFound);

 

Yeah I tried it now and it doesn't quite work like that. Unfortunately, the second parameter cannot be an empty string and I haven't found a string yet which matches everything. But a string with a space works to at least catch all labels containing a space 😅

API_LibPart libPart{};
libPart.typeID = APILib_LabelID;
Int32 numFound;
API_LibPart result[50];
ACAPI_LibPart_PatternSearch (&libPart, " ", result, &numFound);