Use the Circle method to label the entity with the specified ID

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.