2014-07-01 08:39 AM - last edited on 2023-08-01 02:29 PM by Doreena Deng
2014-07-01 10:23 AM
Bianca wrote:Hi Bianca,
I'm needing help to change theelement.door.openingBase.infoof all doors. I've been able to use this API function to change a Wall's info but for some reason no luck with Doors
ACAPI_ELEMENT_MASK_CLEAR (mask);
ACAPI_ELEMENT_MASK_SET (mask, API_OpeningBaseType, info);
CHCopyC(newID, element.door.openingBase.info);
}
ACAPI_ELEMENT_MASK_CLEAR (mask); ACAPI_ELEMENT_MASK_SET (mask, API_Element, door.openingBase.info); CHTruncate (newID, element.door.openingBase.info, sizeof (element.door.openingBase.info));Hope this helps, Akos
2014-07-01 10:35 AM
Bianca wrote:
BNZeroMemory (&element, sizeof (API_DoorType));
Correction wrote:
BNZeroMemory (&element, sizeof (API_Element));
Bianca wrote:
ACAPI_ELEMENT_MASK_SET (mask, API_OpeningBaseType, info);
Correction wrote:
ACAPI_ELEMENT_MASK_SET (mask, API_DoorType, openingBase.info);
API_Element element, mask; GS::Array<API_Guid> elemList; Int32 nElem = 0; GSErrCode err = NoError; char newID[256]; bool *suspGrp; char msgText[256]; err = ACAPI_OpenUndoableSession ("Create Door Unique IDs"); if (err) WriteReport_Err ("ACAPI_OpenUndoableSession failed", err); err = ACAPI_Environment (APIEnv_IsSuspendGroupOnID, &suspGrp, "", ""); if (err) WriteReport_Err ("APIEnv_IsSuspendGroupOnID failed", err); /* suspend group mode */ if (suspGrp == false) { err = ACAPI_Element_Tool (NULL, 0, APITool_SuspendGroups, ""); if (err) WriteReport_Err ("APIEnv_IsSuspendGroupOnID failed", err); } BNZeroMemory (&element, sizeof (API_Element)); ACAPI_Element_GetElemList (API_DoorID, &elemList); for (GS::Array<API_Guid>::ConstIterator it = elemList.Enumerate (); it != NULL; ++it) { element.header.typeID = API_DoorID; element.header.guid = *it; err = ACAPI_Element_Get (&element); if (err == NoError) { ACAPI_ELEMENT_MASK_CLEAR (mask); ACAPI_ELEMENT_MASK_SET (mask, API_DoorType, openingBase.info); sprintf (newID, "%s%d", "Door ", ++nElem); CHCopyC (newID, element.door.openingBase.info); err = ACAPI_Element_Change (&element, &mask, NULL, 0, true); if (err) { WriteReport_Err ("Doors-Create Unique IDs:ACAPI_Element_Change", err); err = NoError; } } } ACAPI_CloseUndoableSession ();
2014-07-02 02:46 AM