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

exploding proxyentities into simple entities
exploding proxyentities into simple entities
i need to read in proxyentities, break them down into simple entities and import these into my application's native format.
i am using the following code called from the proxyentity processing routine:
void oddbentity_export::export(oddbentity* pent, oddbdatabase* pdb) const
{
odrxobjectptrarray entityset;
pent->explode(entityset);
odrxobjectptrarray::iterator pit = entityset.begin();
odrxobject* pobj;
odgeextents3d extents;
for(; pit != entityset.end(); ++pit)
{
pobj = pit->get();
oddbentityptr pent2 = pobj;
pent2->getgeomextents(extents);
odsmartptr<oddbentity_export> pentexport = pobj;
pentexport->export(pent2, pdb);
}
}
i am noticing is that the getgeomextents routine doesn't always get the extents (i've filled it with dummy data and it doesn't overwrite the dummy data).
i'm concerned because the export() call at the end also seems to not be working - i get 2dpolylines and 3dlines from what i understand is a 3d line of some kind. i am also a little concerned about the potential recursive nature of the export call.
in short, i am having trouble getting the simple entities out of something that i have exploded. how do i get the simple entities?
quote:
i am noticing is that the getgeomextents routine doesn't always get the extents (i've filled it with dummy data and it doesn't overwrite the dummy data).
a sample would be helpfull....
quote:
i'm concerned because the export() call at the end also seems to not be working - i get 2dpolylines and 3dlines from what i understand is a 3d line of some kind. i am also a little concerned about the potential recursive nature of the export call.
note that explode() returns an array of pointers to non-database resident objects. their objectid() method will return null. you need to take it into consideration in your export() function.
btw, explodetoblock() replaces entity with database residents. see odamfcapp sample.
sergey slezkin
sample ... as you asked
i have attached a file with a single proxyentity. when reading and processing the file, explode() converts the entity into acdblines and acdb2dpolylines (oddblines and oddb2dpolylines). the line entities have an elevation and the polyline entities don't. i am expecting all to have an elevation because the original should have an elevation.
if i initialize the extents to 0.0, 0.0, 0.0 for min and max before getting the extents (in the code given before), for the acdbline, only one or the other (min or max) point gets updated. the other doesn't change. i have watched this happen or more properly not happen.
thus a line that has coords of 1952,25209,903 and 1953,25209,903 gives extents of minpoint=0,0,0 and maxpoint=1953,25209,903
my help file says i have dd version 1.1101 but i downloaded it around 8/4/05 so whatever version was available then i have.
note: i need to get the basic entities(points, lines, text), so if i explode to a block, i'll need to explode that block eventually to get the basic entities as well. so understanding how to explode and extract basic entities is kind of important.
attached files (130.3 kb, 11 views)

1. oddbline returns coordinates in wcs so z is non-zero. oddb2dvertex returns position in ocs which is defined by oddbpolyline's normal and elevation. to get coordinates in wcs you can use oddb2dpolyline::vertexposition() or to transform coordinates yourself using odgematrix3d:lanetoworld() and elevation stored on polyline (in such case transformation matrix can be built once - not for each vertex.
2. as a result of dd bug text from proxy entity representation sometimes comes as lines and polylines.
3. getgeomextents().
as a result of not absolutely correct implementation some entities assign their extents to output parameter using operator =. and some only add their extents to exising in output parameter. as a work around you can initialize extents as it's done in default constructor:
min = 1.e20
max = -1.e20
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】exploding block references = invisible entities yang686526 DirectDWG 0 2009-05-05 10:17 AM
【转帖】entities not being vectorized yang686526 DirectDWG 0 2009-05-05 09:27 AM
【转帖】coping entities yang686526 DirectDWG 0 2009-05-04 06:18 PM
【转帖】block entities are not erased after the block deleting yang686526 DirectDWG 0 2009-05-04 04:46 PM
【转帖】objectarx&dummies教程(十三)—— deriving from acdbentity yang686526 ObjectARX(C++) 0 2009-04-16 10:40 AM


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


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