几何尺寸与公差论坛------致力于产品几何量公差标准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, 10:21 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】exploding region problem

exploding region problem
exploding region problem
i'm trying to explode all the regions in order to convert them to
simpler entities ; but i can't succeed. if i try to explode the region
contained in the attached file i get no regions when exploding
(the array size is 0).
what should i do to be able to explode regions ?i'm using version 1.13.02
thanks
renaud
code:
void explodeallentitiesofblock(oddbblocktablerecordptr & block)
{
oddbobjectiteratorptr entity_it(block->newiterator());
odrxobjectptrarray exploded_entities;
while (!entity_it->done()) {
oddbentityptr entity(entity_it->entity());
if ((entity->iskindof(oddbproxyentity::desc())) ||
(entity->iskindof(oddbregion::desc()))) {
odrxobjectptrarray array;
entity->explode(array);
std::cout << array.size() << std::endl;
exploded_entities.append(array);
}
entity_it->step();
};
....
}
attached files
i was not able to reproduce this behaviour. what compiler/platform are you using?
vladimir
here is a complete standalone example showing the problem. i made a small project containing all the files in the exservices directory, and i link with
dd_vc6md_spatialindex.lib dd_vc6md_alloc.lib dd_vc6md_gi.lib dd_vc6md_acisrenderer.lib dd_vc6md_acisbuilder.lib dd_vc6md_modelergeometry.lib dd_vc6md_db.lib dd_vc6md_ge.lib dd_vc6md_gs.lib dd_vc6md_root.lib
(i use visual studio 6 on windows xp)
if i explode the region.dxf file (included in my first post) the region entity is not exploded (0 entities received). i link with the following librairies.
code:
#include "odacommon.h"
#include "odadefs.h"
#include "dbdatabase.h"
#include "dbdictionary.h"
#include "dbgroup.h"
#include "tables.h"
#include "entities.h"
#include "gescale3d.h"
#include "exsystemservices.h"
#include "exhostappservices.h"
#include "dbsystemservices.h"
#include "dbhostappservices.h"
#include "dbrasterimage.h"
#include "olestorage.h"
#include "gsbmpdevice.h"
#include <iostream>
class services : public exsystemservices, public exhostappservices
{
protected:
using exsystemservices:perator new;
using exsystemservices:perator delete;
public:
services(): exsystemservices(), exhostappservices() {}
};
odrxobjectimpl<services> & services()
{
static odrxobjectimpl<services> services;
services.disableoutput(true);
return services;
}
void explodeallentitiesofblock(oddbblocktablerecordptr & block)
{
oddbobjectiteratorptr entity_it(block->newiterator());
odrxobjectptrarray exploded_entities;
while (!entity_it->done()) {
oddbentityptr entity(entity_it->entity());
if ((entity->iskindof(oddbproxyentity::desc())) ||
(entity->iskindof(oddbregion::desc()))) {
odrxobjectptrarray array;
entity->explode(array);
std::cout << array.size() << std::endl;
exploded_entities.append(array);
}
entity_it->step();
};
}
void explodeallentities(oddbblocktableptr & blocks)
{
oddbsymboltableiteratorptr block_it(blocks->newiterator());
while (!block_it->done()) {
oddbblocktablerecordptr
block(block_it->getrecordid().safeopenobject(oddb::kforwrite));
explodeallentitiesofblock(block);
block_it->step();
}
}
int main(int argc, char ** argv)
{
if (argc != 2) return 0;
odinitialize(&services());
{
oddbdatabaseptr database;
database = services().readfile(argv[1],
false, false,
oda::ksharedenyno);
oddbblocktableptr blocks =
database->getblocktableid().safeopenobject();
explodeallentities(blocks);
} // to force database destruction
oduninitialize();
return 0;
}
last edited by reno; 28th november 2005 at 02:56 amfff">.
the region was not exploded because modeler was not linked in.
to use modeler functionality you should use following code
code:
#include "rxdynamicmodule.h"
odrx_declare_static_module_entry_point(modelermodule);
odrx_begin_static_module_map()
odrx_define_static_application("modelergeometry", modelermodule)
odrx_end_static_module_map()
and initialize module map later in main()
code:
odrx_init_static_module_map();
for example see odreadex sample.
vladimir
i works. thanks a lot for your help !
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】exploding polyline in region yang686526 DirectDWG 2 2010-04-27 11:05 PM
【转帖】ellipse geometry inside a region yang686526 DirectDWG 0 2009-05-05 09:00 AM
【转帖】color conversion problem dd 1.14.01 yang686526 DirectDWG 0 2009-05-04 05:53 PM
【转帖】cannot open a dwg file in autocad - random problem yang686526 DirectDWG 0 2009-05-04 05:28 PM
【转帖】如何将polyline转化为region yang686526 ObjectARX(VB.NET/C#) 0 2009-04-21 10:07 AM


所有的时间均为北京时间。 现在的时间是 07:50 AM.


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