Modify an object in this drawing.
This function modifies the information for an object already existing in the drawing database. You may have made changes to the object list that you retrieved using sds_entget, so the function sds_entmod writes the changed list permanently into the database.
This function updates the display of the modified object, unless it is a sub-entity (such as part of a block or polyline). For a sub-entity, use the sds_entupd function or Regen command to force a redisplay the object on the screen.
The argument entity-list represents a linked list of result buffers in the same form as that returned by sds_entget. Note that sds_entmod cannot change the object's type or handle.
Text style names, linetype names, shape names, and block names must be already defined in the drawing before your pass the entity list to sds_entmod; layer names are the exception. The list must not include the name of a handle.
This function returns RTNORM or RTREJ, with the reason code in system variable ERRNO.
NOTES
Table Name | Entry |
---|---|
LAYER | All, except extended entity data. |
LINESTYLE | CONTINUOUS |
VPORT | *ACTIVE |
These can be modified but not renamed:
Table Name | Entry |
---|---|
APPID | None. |
BLOCKS | *MODEL_SPACE and *PAPER_SPACE |
DIMSTYLE | STANDARD |
LAYER | 0 |
STYLE | STANDARD |
Example
struct sds_resbuf *templist;
sds_entlast(entname); //Get the name of the last object drawn.
entlist=sds_entget(entname); //Get the resbuf for that object.
//Go through the object's resbuf...
for (templist=entlist;templist->rbnext!=NULL;templist=templist->rbnext)
{
if (templist->restype==62) //When it gets to the color
templist->resval.rint=240; //group, change it to 240.
}
sds_entmod(entlist); //Put the (modified) resbuf back
Tell me about...
Programming Overview of SDS™ (Solutions Development System™)