zoukankan      html  css  js  c++  java
  • 获取块中文字

    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))//命中了包围框
    {
    if (pEnt->isKindOf(AcDbText::desc()))
    {
    AcDbText *pText = NULL;
    pText = AcDbText::cast(pEnt);
    str = pText->textString();
    pText->close();
    return str;
    }
    if (pEnt->isKindOf(AcDbMText::desc()))
    {
    AcDbMText *pmText = NULL;
    pmText = AcDbMText::cast(pEnt);
    str = pmText->contents();
    pmText->close();
    return str;
    }
    if (pEnt->isKindOf(AcDbBlockReference::desc()))
    {
    AcDbBlockReference *pRef = AcDbBlockReference::cast(pEnt);
    str=GetTextForBlock(pRef, pickPoint);
    pRef->close();
    }
    }
    pEnt->close();
    }
    return str;
    }

  • 相关阅读:
    浏览器内核中各个线程之间的关系
    Browser进程和浏览器内核(Renderer进程)的通信过程
    babel 的一些记录
    mac nvm install
    小程序云开发补充
    JavaScript 导学推荐
    网页切片
    初探响应式Web设计
    WEB ICON 的探讨
    [转载]CSS 创作指南(Beta)(css规范)
  • 原文地址:https://www.cnblogs.com/xzh1993/p/5650916.html
Copyright © 2011-2022 走看看