We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2019-06-12 07:33 PM - last edited on 2022-10-04 04:30 PM by Daniel Kassai
GSErrCode JHP_TextToCase(JHP_Text_Case textCase) { GSErrCode err; API_Neig **selNeigs; API_ElementMemo memo; API_Element element, mask; selNeigs = (API_Neig**)BMAllocateHandle(sizeof(API_Neig), ALLOCATE_CLEAR, 0); err = JHP_GetSelectionOrSelect_Mult(&selNeigs); UInt32 nSel = BMGetHandleSize((GSHandle)selNeigs) / sizeof(API_Neig); err = ACAPI_Element_Select(selNeigs, nSel, true); for (UInt32 i = 0; i < nSel; ++i) { BNZeroMemory(&element, sizeof(API_Element)); BNZeroMemory(&memo, sizeof(API_ElementMemo)); element.header.guid = (*selNeigs).guid; element.header.typeID = Neig_To_ElemID((*selNeigs).neigID); if (element.header.typeID != API_TextID) { continue; } if (!ACAPI_Element_Filter(element.header.guid, APIFilt_IsEditable)) { WriteReport_Alert("Object not editable"); break; } if (ACAPI_Element_Get(&element) != NoError) { continue; } ACAPI_ELEMENT_MASK_CLEAR(mask); if (ACAPI_Element_GetMemo(element.header.guid, &memo, APIMemoMask_TextContent) != NoError) { continue; } JHP_ModifyTextCase(textCase, &memo); err = ACAPI_Element_Change(&element, &mask, &memo, APIMemoMask_TextContent, true); ACAPI_DisposeElemMemoHdls(&memo); } BMKillHandle((GSHandle*)&selNeigs); return err; }This code was created following examples in the
JHP_ModifyTextCase(textCase, &memo);merely changes the textContent of the memo to upper or lowercase.
element.text.size, it appears to report the size and if I set the element.text.size in the mask, it still sets the size to a number far lower than it currently is.
2019-06-12 11:43 PM
UInt32 memoMask = 0; memoMask |= APIMemoMask_TextContent; memoMask |= APIMemoMask_Paragraph;