2021-08-13 10:59 AM - last edited on 2021-09-14 09:21 AM by Noemi Balogh
void Do_Label_Edit(short NewPositionvalue) { GSErrCode err; GS::Array<API_Guid> LabelList; short check = 0; err = ACAPI_Element_GetElemList(API_LabelID, &LabelList); short totalLabels = LabelList.GetSize(); // Get the layout Info for (GS::USize i = 0; i < LabelList.GetSize(); i++) { //Do //Change the level boxes position API_ElementMemo memo; API_Element element, mask; BNZeroMemory(&element, sizeof(API_Element)); BNZeroMemory(&memo, sizeof(API_ElementMemo)); element.header.guid = LabelList; // First listed item index element.header.typeID = API_LabelID; err = ACAPI_Element_Get(&element); if (err != NoError) { ErrorBeep("ACAPI_Element_Get", err); return; } ACAPI_ELEMENT_MASK_CLEAR(mask); ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, endC); if (element.label.labelClass == APILblClass_Text) { ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, u.text.loc); element.label.u.text.loc = { 10.5, 3.5 }; } else if (element.label.labelClass == APILblClass_Symbol) { ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, u.symbol.pos); element.label.u.symbol.pos = { 10.5, 3.5 }; } element.label.endC.x = 10.5; element.label.endC.y = 3.5; err = ACAPI_Element_GetMemo(element.header.guid, &memo); if (err != NoError) { ErrorBeep("ACAPI_Element_GetMemo", err); return; } err = ACAPI_CallUndoableCommand("crate new from last drawing", [&]()->GSErrCode { err = ACAPI_Element_Change(&element, &mask, &memo, 0, true); return err; }); if (err == NoError) { check++; } ACAPI_DisposeElemMemoHdls(&memo); } return; // Do_Label_Edit }It will be helpful to me if i get any way to solve this problem.