查看单个帖子
旧 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自动化论坛(仅游客可见)