Defines a new label point for an object.
int
ade_editdefcen(
ads_name ename,
ads_point pt);
Returns RTNORM or an error code.
ename | An AutoCAD entity name. |
pt | The label point, a list of values defined in 2D or 3D point. |
Use this function with property alteration if the current label point is not suitable for the text object you are adding.
The following sample modifies the label point for every entity in the current drawing.
ads_name ename; ads_point newLabelPt; double newLabelPtOffset = 1.25; struct resbuf* pLabelPtValRb = NULL; ads_name selectionSet; acedSSGet("x", NULL, NULL, NULL, selectionSet); long ssLength; acedSSLength( selectionSet, &ssLength; ); for(int i = 0; i < ssLength; ++i) { if(acedSSName(selectionSet, i, ename) == RTNORM ) { pLabelPtValRb = ade_expreval( ename, ".labelpt", "point"); if (NULL != pLabelPtValRb) { newLabelPt[X] = (pLabelPtValRb->resval.rpoint[0] - newLabelPtOffset); newLabelPt[Y] = (pLabelPtValRb->resval.rpoint[1] - newLabelPtOffset); int resultCode = ade_editdefcen( ename, newLabelPt); } else { acutPrintf( "\nThe label point could not be determined."); } } else { acutPrintf( "\nCould not get the entity."); } } acutRelRb(pLabelPtValRb); acedSSFree(selectionSet);