Gets the ID of all entities that have the specified extended data and is stored in the ID array

Source: Internet
Author: User

Acdbobjectidarray Obtainentid ()
{
Get Block table
Acdbblocktable *pblktbl;
Acdbhostapplicationservices ()->workingdatabase ()
->getblocktable (PBLKTBL, Zcdb::kforread);
Get block Table records
Acdbblocktablerecord *PBLKTBLRCD;
Pblktbl->getat (Acdb_model_space, PBLKTBLRCD, zcdb::kforwrite);
Pblktbl->close ();
Create a walker
Acdbblocktablerecorditerator *piter = NULL;
Pblktblrcd->newiterator (Piter);

Acdbobjectidarray Entids;
Traverse all entities to get their IDs
For (Piter->start ();!piter->done (); Piter->step ())
{
Using a walker to get each entity
Acdbentity *pent = NULL;
Acad::errorstatus es = piter->getentity (pent, Acdb::kforread, false);
if (acad::eok! = es)
{
acutprintf (_t ("\ n" Open entity failed! "));
return false;
}

Gets the list of specified extended data
struct RESBUF *PRC;
struct RESBUF *prc1;

PRc = Pent->xdata (_t ("Bmc_no_app"));
PRC1 = Pent->xdata (_t ("Bmesc_cable_app"));

If the list of two extended data is equal, the ID of this entity is stored in Entids
if (pRc! = NULL && PRC1! = null)
{
Entids.append (Pent->objectid ());
}
Pent->close ();
}
Delete Piter;
Pblktblrcd->close ();
return entids;
}

Gets the ID of all entities that have the specified extended data and is stored in the ID array

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.