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

problem in oddbminsertblock::explode()
problem in oddbminsertblock::explode()
when reading the attached dxf file using dwgdirect 2.6.3, i have run into a problem with oddbminsertblock::explode().
i call oddbminsertblock::explode() on the minsertblock object with handle 177f0 (pointing to block "lrc"). then i iterate through the returned collection of objects. in this case, the only object in the collection is a oddbtext object. when i call oddbtextsition(), the coordinates in the returned point are the ones in the "lrc" block definition, and do not appear to have had the insert block's insertion point applied to them.
there are many oddbinsertblock objects in the file. most of them refer to blocks that contain oddbline objects, and did not have this problem when i called explode() on those, just the ones that refer to blocks that contain oddbtext objects.
i did not run into this problem in dwgdirect 2.5.2.
i am using windows xp and visual studio 2005.
thanks,
bob
attached files
this is a regression indeed. we'll investigate that, thanks for your report.
vladimir
thanks for the reply.
are you planning a bug fix release in the near future?
bob
bugfix release, no, but next major release is not far away.
version 2.7
beta: november 10, 2008
production: december 8, 2008
vladimir
is there a work-around we could use until the fix comes out? i have tried a couple of things:
1) when reading the original oddbminsertblock object, capture the oddbminsertblock::blocktransform() matrix and use it to transform the oddbtextsition() in the text object that results from the call to oddbminsertblock::explode(). in this case, the resulting point is correct, but the text is not rotated properly.
2) again using the oddbminsertblock::blocktransform() matrix, call oddbtext::transformby() on the text object that results from oddbminsertblock::explode(). this call fails with an odresult of ecannotscalenonuniformly.
is there something else i should be doing instead?
thanks,
bob
you may try gettransformedcopy() method.
vladimir
thanks for the tip...i missed that method in the documentation. unfortunately, the copy of oddbtext returned by oddbtext::gettransformedcopy() seems to be the same as the original...it doesn't seem to be transformed. when i run the following code, i get the same result as i did when i didn't call oddbtext::gettransformedcopy().
code:
// m_blockinsertmatrix is the matrix returned from minsertblock::blocktransform()
oddbtextptr pdwgtext = pentity; // pentity is an entity returned by minsertblock::explode()
if (!pdwgtext->isdbro())
{
// we are using entity that is result of explode() call...make a transformed copy.
oddbentityptr tempcopy;
odresult result = pdwgtext->gettransformedcopy(m_blockinsertmatrix, tempcopy);
if (result == eok)
{
pdwgtext = tempcopy;
}
}
odgepoint3d pos = pdwgtext->position();
if (pdwgtext->isdbro())
{
// store the point info from pos -- no transform needed
}
else
{
// put the point in the correct location based on info from the block reference.
// i have to do this even though i already called gettransformedcopy().
odgepoint3d loc = pos.transformby(m_blockinsertmatrix);
// store point info from loc
}am i doing something wrong?
bob
as a result of regression in 2.6.3 oddbtext::gettransformedcopy() does not work for non-uniscaled matrix.
this is fixed already (cr5439) the fix is available for founders at svn and will be included in next release.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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



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


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