几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】how to use dwgdirect to retrieve geometry objects (http://www.dimcax.com/hust/showthread.php?t=16788)

yang686526 2009-05-06 03:20 PM

【转帖】how to use dwgdirect to retrieve geometry objects
 
how to use dwgdirect to retrieve geometry objects?
how to use dwgdirect to retrieve geometry objects?
hi,
i am newly client of dwgdirect. someone can tell me which class i must use to get all the geometry base class of a dwg file.
i mean :
for all line, get a line geometry and his atttributes ( color, type..)
for all polyline, get n vertex and theirs attributes..
....
i have parsed the exemple odreadex but the entity dump methode does not respond entirely my need.
i have to implement an import dwg in my application,so.
thanks.
mlp
hello -
if you go back to the readex example - take a look into the file exprotocolextension.cpp. in there you will find the instantiation of the following classes ...and many more ...
oddb2dpolylineptr
oddb3dpolylineptr
oddbpolyfacemeshptr
oddbblockreferenceptr
oddbminsertblockptr
oddbsplineptr
each of these encasulates the data you are seeking.
hi walt,
thanks for your rapid reponse, but as i said, this 'ptr is given in the exemple in the mecanism of entity dumper. and i constate that treat sequencially objects in the order they are created.
i mean that if i create 1 line, a polyline and next a line.
the dump mecanism will dump : line (1), a polyyline (2) and next a line (3). and i do not known how to get their attribute as color or type.
i want to implement an algorithm as below:
open a dwg file,
for each object type ( line, polyline,mesh, face,3d )
get n, a number of object type,
and finally:
a methode to retrieve data ( geometry and attribute ) of an n-th objet.
thanks more.
mlp
mlp


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