Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.
2023-10-19
07:30 AM
- last edited on
2024-09-16
02:29 PM
by
Doreena Deng
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.
2023-10-19 07:41 AM
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.
2023-10-19 07:51 AM - edited 2023-10-19 07:52 AM
2023-10-19 08:22 AM
@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.
2023-10-19 09:21 AM - edited 2023-10-20 04:43 AM
2023-10-20 08:33 AM
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
2023-10-22 01:39 PM
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);
2023-10-24 10:52 PM
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);