Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible with an API to connect a new element to an existing label?

LeeJaeYoung
Expert

ACAPI_ELEMENT_MASK_CLEAR(mask);
ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, parent);


element.label.parent = guid;

err = ACAPI_Element_Change(&element, &mask, &memo, 0, true);

This code is wrong. 

The label is not associated with a new element.

1 ACCEPTED SOLUTION

Solution
poco2013
Advisor

I believe that once created and placed, the status of a label can not be changed. This is because associated labels acquire the guid of the element they are attached to. Maybe wrong on this one?

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

View solution in original post

3 REPLIES 3

Solution
poco2013
Advisor

I believe that once created and placed, the status of a label can not be changed. This is because associated labels acquire the guid of the element they are attached to. Maybe wrong on this one?

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

LeeJaeYoung
Expert

This is the part I don't understand.
If it's because of the Guid, it's because you'll have to re-specify the Guid.
If I need to fetch information via Guid, but there is no command to get it back, then I can understand.
This article was translated from translate.google.com.

LeeJaeYoung
Expert

I know what you said is true.
thank you.
Have a nice day
API_LabelType
parent 
When creating new Labels,
set this to APINULLGuid to create an independent Label; or
set this to the GUID of the owner element (a labelable element) to create an associative Label.

When getting or changing a Label, this member will be filled with the GUID of the owner element,
or APINULLGuid, if the Label is independent.
It is not allowed to make an existing associative Label independent,
or make an existing independent Label associative.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!