zoukankan      html  css  js  c++  java
  • 将块中的文字设置成属性,即实现块中文字可拖动的功能

    bool CInsertTyDlg::AlterDefinition(AcDbBlockReference *pRef, AcDbObjectId objId)
    {
    AcDbBlockTableRecord *pBlkTabRcd = NULL;
    acdbOpenObject(pBlkTabRcd, objId, AcDb::kForWrite);
    if (pBlkTabRcd->hasAttributeDefinitions())
    {
    AcDbBlockTableRecordIterator *pItr = NULL;
    pBlkTabRcd->newIterator(pItr);
    AcDbEntity *pEnt = NULL;
    for (pItr->start(); !pItr->done(); pItr->step())
    {
    pItr->getEntity(pEnt, AcDb::kForWrite);
    AcDbAttributeDefinition *pAttDef = NULL;
    pAttDef = AcDbAttributeDefinition::cast(pEnt);
    if (pAttDef != NULL)
    {
    AcDbAttribute *pAtt = new AcDbAttribute();
    pAtt->setPropertiesFrom(pAttDef);
    pAtt->setInvisible(pAttDef->isInvisible());
    AcGePoint3d ptBase = pAttDef->position();
    ptBase += pRef->position().asVector();
    pAtt->setPosition(ptBase);
    pAtt->setHeight(pAttDef->height());
    pAtt->setRotation(pAttDef->rotation());
    pAtt->setTag(pAttDef->tag());
    CString str = pAttDef->textString();
    pAtt->setTextString(str);
    pRef->appendAttribute(pAtt);
    pAtt->close();
    }
    pEnt->close();
    pAttDef->close();
    }
    delete pItr;
    }
    pRef->close();
    pBlkTabRcd->close();
    return true;
    }

    AcDbAttributeDefinition *pAttDef = new AcDbAttributeDefinition();
    pAttDef->setPosition(ptInsert);
    pAttDef->setTag(strProperty);
    pAttDef->setTextString(strValue);
    pAttDef->setTextStyle(textId);
    pAttDef->setHeight(pText->height());
    pBlkTabRcd->appendAcDbEntity(pAttDef);
    pAttDef->close();
    pText->erase();

  • 相关阅读:
    ORM
    优酷:exec 补充,元类,优酷构架,ORM。
    数据库 事务。
    Python操作mysql
    数据库对表操作的练习题总结。
    ACM-ICPC 2018 南京赛区网络预赛 E. AC Challenge (状压DP)
    CodeForces
    CodeForces
    AcWing 314. 低买 (线性DP)打卡
    AcWing 313. 花店橱窗 (线性DP)打卡
  • 原文地址:https://www.cnblogs.com/xzh1993/p/5032975.html
Copyright © 2011-2022 走看看