几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】求助:调试的问题。 (http://www.dimcax.com/hust/showthread.php?t=7882)

yang686526 2009-04-18 05:23 PM

【转帖】求助:调试的问题。
 
求助:调试的问题。
求助:调试的问题。
这是我编的一个选取实体来生成block的一段程序,但是当调试运行到:err=acdbgetobjectid(idsel,sget);
跳出上面的find symble的 对话框,"please enter the path for acdbhdr.pdb"不知道什么意思。。。
并且编译以后,在cad中运行并不能生成图块,但是凭我的水平怎么也找不出问题了。
希望哪位大虾能帮帮我,先谢了。
#include "stdafx.h"
#include "stdarx.h"
#include "resource.h"
#include "dbsymtb.h "
#include "acedads.h"
#include "dbmain.h"
// this is command 'setlayer'
void asdkpblock()
{
bool const openerasedentity = false;
bool const openerasedrec = false;
ads_name sget;
ads_point pt;
acdbobjectid idsel;
acdbentity *entsel;
acad::errorstatus err;
int rc=1;
acdbblocktablerecord *pselrec=new acdbblocktablerecord;
pselrec->setname("firstblock");
pselrec->setorigin(acgepoint3d(0,0,0));
while(rc)
{
rc=acedentsel("\nplease select an entity:",sget,pt);
switch(rc)
{
case rtnorm:
err=acdbgetobjectid(idsel,sget);
if(err!=acad::eok)
{
acutprintf("\n invalid ads_name.");
return;
}
acutprintf("\n objectid is %s",idsel);
acdbopenacdbentity(entsel,idsel,acdb::kforread,openerasedentity);
entsel->highlight();
pselrec->appendacdbentity(entsel);
entsel->close();
acedssfree(sget);
break;
case rterror:
acutprintf("\n invalid selection.");
return;
break;
case rtcan:
acutprintf("\n selection over.");
rc=0;
break;
} //end of switch.
}
acdbdatabase *pcurdb=null;
acdbblocktable *pbtable;
pcurdb=acdbhostapplicationservices()->workingdatabase();
pcurdb->getblocktable(pbtable,acdb::kforwrite);
pbtable->add(pselrec);
pbtable->close();
pselrec->close();
}
此主题相关图片如下:
我的这个可以点选以生成块,
void test()
{
ads_name en;
ads_point pt;
int rt=1;
acad::errorstatus es;
acdbblocktable *pblocktable;
acdbhostapplicationservices()->workingdatabase()->getsymboltable(pblocktable,acdb::kforwrite);
acdbblocktablerecord *pblk=new acdbblocktablerecord;
es=pblk->setname("testblk");
es=pblk->setorigin(acgepoint3d(0,0,0));
// -------------------
while (rt)
{
rt=acedentsel("\nspecify a object:",en,pt);
switch(rt)
{
case rterror:
acutprintf("\n invalid selection.");
break;
case rtcan:
acutprintf("\n selection over.");
rt=0;
break;
case rtnorm:
acdbobjectid eid;
acdbgetobjectid(eid,en);
acdbentity *pent=null,*pclone=null;
es=acdbopenacdbentity(pent,eid,acdb::kforread);
pclone=acdbentity::cast(pent->clone());
es=pblk->appendacdbentity(eid,pclone);
pblocktable->add(eid,pblk);
pent->close();
pclone->close();
break;
}
}
// ------------------------
pblk->close();
pblocktable->close();
}
江苏昆山小城,欢迎交流
本职工作五金模具设计及加工
及cad软件开发
呵呵,谢谢,想明白是什么问题了。
还有一个问题是:当在调试模式下面,运行到acdbgetobjectid()时,会跳出一个find symble对话框,提示:"please enter the path for acdbhdr.pdb" 不知道什么意思。。。
不知各位碰到过没有。我选择的 结束 ,没有理它,但是并不影响程序的运行。如果不在调试模式下,就不会出现这个问题。
我用的是vc++6.0和acad
我也不知道,我也是半桶水,应该还没有半桶昵,
我用的也是 vc6+cad
好啊好啊。。。。
其实觉得学objectarx也不难,有帮助文档就可以啦。现在开始有整体的感觉了。
silence of happiness....


所有的时间均为北京时间。 现在的时间是 05:59 PM.