huangyhg 发表于 2003-10-25 22:06:00

lilin,帮我解答一下这个问题,好吗?

lilin,网上邮箱打不开!(arx2000)
通过检索“printdxf”得到一份帮助代码,但我在调试时报错:
An ObjectARX application could retrieve and print the definition data for an entity by using the following two functions. (The printdxf() function does not handle extended data.)

void getlast()
{
    struct resbuf *ebuf, *eb;
    ads_name ent1;

    acdbEntLast(ent1);
    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);          //printdxf此函数没有类型定义????报错一

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

int printdxf(eb)
struct resbuf *eb;      //这句就更不清楚是怎么回事了?又是int,又是struct

                               //而且一个指针*eb没有赋值
   
{
    int rt;

    if (eb == NULL)
      return RTNONE;

    if ((eb->restype >= 0) && (eb->restype <= 9))
      rt = RTSTR ;
    else if ((eb->restype >= 10) && (eb->restype <= 19))
      rt = RT3DPOINT;
    else if ((eb->restype >= 38) && (eb->restype <= 59))
      rt = RTREAL ;
    else if ((eb->restype >= 60) && (eb->restype <= 79))
      rt = RTSHORT ;
    else if ((eb->restype >= 210) && (eb->restype <= 239))
      rt = RT3DPOINT ;
    else if (eb->restype < 0)
// Entity name (or other sentinel)
      rt = eb->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, eb->resval.rpoint,
            eb->resval.rpoint);
      break;

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

    case -1:
    case -2:
// First block entity
      acutPrintf("(%d . <Entity name: %8lx>)\n",
            eb->restype, eb->resval.rlname);
    }

    return eb->restype;
}
我傻了,能帮我解答一下吗?我想提取形位公差的数据信息,还有其他样例吗?
形位公差的restype =1

goldenshin 发表于 2003-10-27 10:14:00

int printdxf(eb)
struct resbuf *eb

这是一种老式的C风格.
建议用以下, int printdxf(struct resbuf *eb) 代替

huangyhg 发表于 2003-10-27 21:12:00

谢谢斑竹,
我今天调试,结果出来了!将形位公差图元中所有的信息都提取出来了
不错不错!happy...........................
页: [1]
查看完整版本: lilin,帮我解答一下这个问题,好吗?