乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 5|回复: 0

初级练习!!!

[复制链接]

83

主题

203

帖子

8

银币

中流砥柱

Rank: 25

铜币
535
发表于 2007-3-26 22:58:00 | 显示全部楼层 |阅读模式
1.提取实体的扩展数据,本代码在VC++6.0,2002通过
//
// ObjectARX defined commands
#include "StdAfx.h"
#include "StdArx.h"
// This is command 'TEST'
int printdxf(struct resbuf *eb);
void test()
{
// TODO: Implement the command
    struct resbuf *ebuf, *eb;
    ads_name ent1;
ads_point pt;

    acedEntSel("\n请选择对像",ent1,pt);
    ebuf = acdbEntGet(ent1);

    eb = ebuf;

    acutPrintf("\nResults of entgetting last entity\n");

// Print items in the list.
    for (eb = ebuf; eb != NULL; eb = eb->rbnext)
        printdxf(eb);

// Release the acdbEntGet() list.
    acutRelRb(ebuf);
}

int printdxf(struct resbuf *eb)
{
    int rt;

    if (eb == NULL)
        return RTNONE;

    if ((eb->restype >= 0) && (eb->restype restype >= 10) && (eb->restype restype >= 38) && (eb->restype restype >= 60) && (eb->restype restype >= 210) && (eb->restype restype restype;
    else
        rt = RTNONE;

    switch (rt) {

    case RTSHORT:
        acutPrintf("(%d . %d)\n", eb->restype,
            eb->resval.rint);
        break;

    case RTREAL:
        acutPrintf("(%d . %0.3f)\n", eb->restype,
            eb->resval.rreal);
        break;

    case RTSTR:
        acutPrintf("(%d . \"%s\")\n", eb->restype,
            eb->resval.rstring);
        break;

    case RT3DPOINT:
        acutPrintf("(%d . %0.3f %0.3f %0.3f)\n",
            eb->restype,
            eb->resval.rpoint[X], eb->resval.rpoint[Y],
            eb->resval.rpoint[Z]);
        break;

    case RTNONE:
        acutPrintf("(%d . Unknown type)\n", eb->restype);
        break;

    case -1:
    case -2:  
// First block entity
        acutPrintf("(%d . )\n",
            eb->restype, eb->resval.rlname[0]);
    }

    return eb->restype;
}
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-6 00:50 , Processed in 0.308918 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表