Entid the ID of the specified entity
void Signent (Acdbobjectid entid)
{
Acdbentity *pent = NULL;
Acdbblockreference *pref;
Open the corresponding entity
Acad::errorstatus es = acdbopenobject (pent, Entid, Zcdb::kforread, false);
if (acad::eok! = es)
{
acutprintf (_t ("\ n" \ nthe entity that opened the corresponding ID failed! "));
return;
}
if (Pent->iskindof (acdbblockreference::d ESC ()))
{
Convert an entity to a block reference
PRef = Acdbblockreference::cast (pent);
Get the frame of a block reference
Acdbextents exts;
Pref->getgeomextents (exts);
Acgepoint3d ptmin = Exts.minpoint ();//Frame min.
Acgepoint3d Ptmax = Exts.maxpoint ();//outer box maximum point
Gets the center point of the outer frame of the block reference, which is written by the midpoint function, which is the center point between two points
Acgepoint3d Ptcenter = Midpoint (ptmin, Ptmax);
Pref->close ();
Get half the length of the two-point line, and the Halflength function writes for itself, which is half the length of the two-point connection.
Double radius = halflength (ptmin, Ptmax);
Draw a circle at the center of the insertion point, marking the repeating number
Acgevector3d VEC (0, 0, 1);
Create a solid Circle
Acdbcircle *pcircle = new Acdbcircle (ptcenter, VEC, radius);
Adding a circle to model space, the Posttomodelspace function is written for itself, to add entities to model space
Posttomodelspace (pcircle);
}
Use the Circle method to label the entity with the specified ID