明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2223|回复: 5

用ObjectARX时,先选择后执行有没有问题?

[复制链接]
发表于 2008-1-11 13:06:00 | 显示全部楼层 |阅读模式

我是用VB的,对ObjectARX不了解。

在用VB时,如先选择实体后执行命令,常常会产生接口错误,

即时用VB获得AutoCAD的Pickfirst选择集时,产生错误。

不知道用ObjectARX时有没有这种问题?

发表于 2008-1-13 14:18:00 | 显示全部楼层
应该没有这种问题
发表于 2008-1-16 13:55:00 | 显示全部楼层
肯定没有的啦.
 楼主| 发表于 2008-2-21 21:57:00 | 显示全部楼层

运行了以下的程序,没有发现问题。

看来,今后还是要用ObjectARX C++来开发AutoCAD的应用程序。

static void test_pickfirst(void)
 {
  ads_name ssname, ent;
  long nssmem, i;
  struct resbuf *ebuf, *eb;
  // Get the current PICKFIRST set, if there is one;
  // otherwise, ask the user for a general entity selection.
  if (acedSSGet(NULL, NULL, NULL, NULL, ssname)!= RTNORM) {
     return;
  }
  if (acedSSLength(ssname, &nssmem) != RTNORM) {
     return;
  }
  acutPrintf(_T("\n %ld\n"),nssmem);

  for (i=0; i<nssmem; i++){
   if (acedSSName(ssname, i, ent) != RTNORM){
    acdbFail(_T("\nFail\n"));
    return;
   }
   ebuf = acdbEntGet(ent);
   for (eb = ebuf; eb != NULL; eb = eb->rbnext) {
    printdxf(eb); //1. To print the dxf code of the entity(defined in other file.cpp)
   }
   acutRelRb(ebuf);
  }
  acedSSFree(ssname);
 }

发表于 2012-2-23 15:52:09 | 显示全部楼层
我咋没看见有pickfirst这类的语句呢!
发表于 2012-2-23 19:12:34 | 显示全部楼层
在帮助文档中查看下面的文字
ACRX_CMD_USEPICKSET
会有答案
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-2-21 03:27 , Processed in 0.187142 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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