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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-05, 11:15 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】get line name

get line name
get line name
hello
i have a problem when obtaining the name of an object of the following form
code:
odstring (circle_->isa()->name());
whit this exception:
code:
excepci髇 no controlada en 0x20e0f921 (dwgannotd.dll) en 3dviewerd.exe: 0xc0000005: infracci髇 de acceso al leer la ubicaci髇 0x00000000.
thanks klvin
hello
are you sure that pointers are not null ?
the first line work ok but the second try exception...
code:
odgepoint3d centerpoint = circle_->center();
std::string isa (circle_->isa()->name());
thx klvin
does
code:
circle_->isa()->name();
throw exception too ?
did circle_->isa() return null ?
did circle_->isa() return null ?
yes the result that line is null!!!
there is some other form to obtain the name?
rxobject.h has odrxclass* classname::isa() const { return g_pdesc; }
g_pdesc must be initialized by oddbcircle::rxinit() call in user application. i think that mfcapp hasn't problems with your code. very big changes that your application forgot about oddbcircle::rxinit().
one moment also - toolkit has method odinitialize(this); it calls rxinit for all libraries classes.
quote:
one moment also - toolkit has method odinitialize(this); it calls rxinit for all libraries classes.
i already initialize the bookstores without no error
code:
bool dwgapplication::launch()
{
std::cout << "launching dwg" << std::endl;

//inicializamos dwgdirect
boost::format berr ("\nerror al inicializar directdwg: %1%");
try
{
// funci髇 para la inicializaci髇 de dwgdirect.
odinitialize(&svcs_);
} catch (const oderror& e)
{
berr % svcs_.geterrordescription(e.code());
std::cout << berr.str().c_str() << std::endl;
return false;
}
return true;
}
hello,
does your application fully based on mfcapp or other our sample ?
please, insert next code after odinitialize and in place before exception. is it return exception in both variants?
odrxclass* prx = oddbcircle::desc();
oddbcircleptr pc = oddbcircle::createobject();
odrxclass* prx2 = pc->isa();
thanks for the aid, already i have solved it?the problem is that it made a call to
code:
oduninitialize ();
now i have the following code
code:
std::string isa (circle_->isa()->name());
std::string name (circle_->getdbhandle().ascii());
return (isa + " - " + name);
i obtain isa correctly () but the sentence getdbhandle () gives back 0 to me, i don磘 know!!!
is oduint64 n = getdbhandle() return '0' ?
it means that your object is non database resident yet. object was created by ::createobject, but it wasn't added to database.
next code will add pcircle to modelspace.
oddbdatabaseptr pdb = ...;
oddbblocktablerecordptr pms = pdb->getmodelspaceid().safeopenobject(oddb::kforwrite) ;
pms->appendoddbentity( pcircle );
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】asme - where to star yang686526 American standards 0 2009-04-29 07:28 PM
自动扶梯安装图自动绘制原程序 yang686526 ObjectARX(AutoLISP) 0 2009-04-27 11:59 AM
[求助]请教高手,这段程序能否简化一下呢? yang686526 ObjectARX(AutoLISP) 0 2009-04-26 02:45 PM


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


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多