![]() |
【转帖】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 |
所有的时间均为北京时间。 现在的时间是 08:05 PM. |