明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1641|回复: 0

[求助]

[复制链接]
发表于 2002-8-4 18:22:00 | 显示全部楼层 |阅读模式
我怎么把一个选择集放到一个属性块的定义里去?我是这样做的,但不行!请帮帮我
        acutPrintf("It is begin!\n");
        int retCode = 0;
        AcDbBlockTable *pBlockTable = NULL;
    AcDbBlockTableRecord *pBlockRecord=new AcDbBlockTableRecord;
        AcDbObjectId entId,blockId;
        ads_name ss;
        AcDbEntity *pEnt;
    ads_point pt1,pt2;

        AcGePoint3d basepoint;
        pBlockRecord->setName("BlockWithAttribute");
    if(acedGetPoint(NULL,"lease input a point:\n",asDblArray(basepoint))!=RTNORM)
    return;
     

    pBlockRecord->setOrigin(basepoint);
        acdbHostApplicationServices()->workingDatabase()
                ->getSymbolTable(pBlockTable,AcDb::kForWrite);
    pBlockTable->add(blockId,pBlockRecord);
   
    if(acedGetPoint(NULL,"请输入左上角:\n",pt1)!=RTNORM)
    return;
         if(acedGetPoint(NULL,"请输入右下角:\n",pt2)!=RTNORM)
    return;

    acedSSGet("C",pt1,pt2,NULL,ss);
    acdbGetObjectId(entId,ss);
    acdbOpenObject(pEnt,entId,AcDb::kForNotify);
    pBlockRecord->appendAcDbEntity(entId,pEnt);
        //pCircle->close();
    acedSSFree(ss);

        AcDbAttributeDefinition *pAttdef = new AcDbAttributeDefinition;
    pAttdef->setPosition(basepoint);
    pAttdef->setHeight(10);
        pAttdef->setRotation(0);
    pAttdef->setHorizontalMode(AcDb::kTextLeft);
    pAttdef->setVerticalMode(AcDb::kTextBase);
    pAttdef->setPrompt("prompt");
    pAttdef->setTextString("DEFAULT");
    pAttdef->setTag("Tag");
        pAttdef->setInvisible(Adesk::kFalse);
    pAttdef->setVerifiable(Adesk::kFalse);
        pAttdef->setPreset(Adesk::kFalse);
        pAttdef->setConstant(Adesk::kFalse);
        pAttdef->setFieldLength(Adesk::kFalse);

        pBlockRecord->appendAcDbEntity(entId,pAttdef);

        pAttdef->close();
        pBlockRecord->close();
    pBlockTable->close();
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 06:54 , Processed in 0.129700 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表