Get text in block

Source: Internet
Author: User

CString Dialog::gettextforblock (acdbblockreference *pref, Acgepoint3d pickpoint)
{
Acdbentity *pent;
CString str=_t ("");
Acdbvoidptrarray Ptarr = NULL;
Acad::errorstatus Es=pref->explode (Ptarr);
int ilen = Ptarr.length ();
for (int i = 0; i < ilen;i++)
{
Pent = static_cast<acdbentity*> (Ptarr[i]);
Acdbextents ext;
Pent->getgeomextents (EXT);
Auto MINPT = acadutils::convertto2d (Ext.minpoint ());
Auto MAXPT = acadutils::convertto2d (Ext.maxpoint ());
Acgepoint2darray pts;
Pts.append (MINPT);
Pts.append (ACGEPOINT2D (Minpt.x, Maxpt.y));
Pts.append (MAXPT);
Pts.append (ACGEPOINT2D (Maxpt.x, Minpt.y));
if (Xfuntion (). Ptinregioninxyplate (Pickpoint, pts) && xfuntion (). Ptinregioninxyplate (Pickpoint, pts))//Hit the bounding box
{
if (Pent->iskindof (acdbtext::d ESC ()))
{
Acdbtext *ptext = NULL;
Ptext = Acdbtext::cast (pent);
str = ptext->textstring ();
Ptext->close ();
return str;
}
if (Pent->iskindof (acdbmtext::d ESC ()))
{
Acdbmtext *pmtext = NULL;
PMText = Acdbmtext::cast (pent);
str = pmtext->contents ();
Pmtext->close ();
return str;
}
if (Pent->iskindof (acdbblockreference::d ESC ()))
{
Acdbblockreference *pref = acdbblockreference::cast (pent);
Str=gettextforblock (PRef, pickpoint);
Pref->close ();
}
}
Pent->close ();
}
return str;
}

Get text in block

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.