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

leader entity problem
leader entity problem
hello,
when i try to read a leader entity from dxf/dwg drawing, through new dwgdirect library, i do not get the same vertices as they are written in the file.
i am sending the example file with one leader. this leader has following vertices:
x=364.9086605817775 y=82.68423390356929
x=374.7039270310275 y=97.00553519244294
x=377.2039270310274 y=97.00553519244294
bu when i read the vertices with this code:
for (int i=0; i < pleaderent->numvertices(); i++)
{
odgepoint3d point;
point = pleaderent->vertexat(i);
...
}
i get only these two vertices:
x=364.90866058177750 y=82.684233903569293
x=377.20392703102749 y=84.507201859109600
why is not second vertex the same as in the file?
how can i get the last two vertices, that are written in the file? (or at least i would like to get the last vertex of leader entity)?

regards, tomaz.
attached files
i'm stumped. i looked at it and verified you conclusion. the code shows this for the filer which generates that "missing" vertex:
if(pimpl->hashookline() && i == pimpl->m_points.size() - 1l)
{
odgepoint3d temppt = pimpl->m_points.at(i);
double hooklength = dimasz();
if (!pimpl->ishooklineonxdir())
hooklength = -hooklength;
temppt += pimpl->xdir() * hooklength;
pfiler->wrpoint3d(10, temppt);
}
however - the vertexat() agrees with autocads gui. very strange.
perhaps sergey can shed some light on this?
if direction of last leader's segment differs from annotation x direction by more than 15 degrees autocad while rendering the leader generates one extra vertex to make hook line having annotation's "horizontal" direction.
for example a leader like in your file is drawn in autocad by 2 mouse clicks. the 3-d (middle) vertex is added by autocad during rendering. actually only 2 vertices are stored at run time and in dwg file. while saving to dxf autocad (and dd) adds to file this extra vertex and removes it while dxf loading.
so for the leader from your your example you should get 2 vertices - first and last ones.
are you sure that the second vertex you get differs from the last vertex stored in file?
sergey slezkin
sergey,
i am sure, that the second vertex i get is not the same as the last one in the file.
in the first post are exact values of all vertices, which i get from dwgdirect library.
regards, tomaz
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】getting modelspace object pointer for write 9programming te yang686526 DirectDWG 0 2009-05-05 11:30 AM
【转帖】explode problem in latest version 91.0.14.10 yang686526 DirectDWG 0 2009-05-05 10:09 AM
【转帖】cannot open a dwg file in autocad - random problem yang686526 DirectDWG 0 2009-05-04 05:28 PM
【转帖】a strange problem for oddbtext entity yang686526 DirectDWG 0 2009-05-04 03:16 PM
【转帖】objectarx&dummies教程(十三)—— deriving from acdbentity yang686526 ObjectARX(C++) 0 2009-04-16 10:40 AM


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


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