Deletes a node from a polygon.
GSErrCode ACAPI_Goodies (
APIAny_DeletePolyNodeID,
API_ElementMemo* memo,
Int32* inIndex
);
Parameters
- memo
- [in/out] The polygon data.
- inIndex
- [in] node index (subindex of the element) to delete
Return Values
NoError- The function has completed with success.
APIERR_BADPARS- any of the parameters are
nullptror invalidnodeIndexpassed ormemois not initialized APIERR_MEMFULL- low memory condition
APIERR_IRREGULARPOLY- Input polygon or polyline is irregular.
For other common API errors see the API Errors document.
Remarks
This function is used to delete a node from a polygon passed in an API_ElementMemo structure.
Refer to the API_Polygon structure to have more details on the polygon data structure. The coords, pends, parcs and vertexIDs handles in the API_ElementMemo structure must be initialized.
Note that other memo handles are not touched. In the case the polygon belongs to a roof with side angles initialized, it must be aligned manually.
Examples
/*----------------------------------------------------------** ** Insert a new node into the clicked poly edge ** **----------------------------------------------------------*/ static void Do_Poly_DeleteNode (void) { API_ElementMemo memo; API_Neig neig; API_ElemTypeID idElem; Int32 nodeInd; Int32 nSubPolys, i, begInd, endInd; GSErrCode err; if (!ClickAnElem ("Click a node to delete", API_ZombieElemID, &neig, nullptr, nullptr, nullptr)) { GiveMessage ("Please click a polygon node", true); return; } if (neig.neigID != APINeig_Ceil && neig.neigID != APINeig_Roof) { GiveMessage ("Please click a ceil or roof node", true); return; } idElem = Neig_To_ElemID (neig.neigID); err = ACAPI_Element_GetMemo (neig.guid, &memo); if (err) { GiveMessage_Err ("ACAPI_Element_GetMemo", err); return; } nodeInd = neig.inIndex; err = ACAPI_Goodies (APIAny_DeletePolyNodeID, &memo, &nodeInd); if (!err) { switch (idElem) { case API_SlabID: /* nothing to do */ break; case API_RoofID: if (memo.roofSides != nullptr && *memo.roofSides != nullptr) { /* delete roofSide rec; [nodeInd] */ } default: return; /* never got there */ } err = ACAPI_Element_ChangeMemo (neig.guid, APIMemoMask_Polygon, &memo); if (err) GiveMessage_Err ("ACAPI_Element_ChangeMemo", err); } else GiveMessage_Err ("APIAny_DeletePolyNodeID", err); ACAPI_DisposeElemMemoHdls (&memo); return; }
Requirements
- Version: API 4.1 or later
- Header: APIdefs_Goodies.h
See Also
API_Polygon, API_ElementMemo,
APIAny_InsertPolyNodeID, APIAny_InsertSubPolyID, APIAny_DeleteSubPolyID,
ACAPI_Goodies, API Functions