几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】retrieving 3dsolid Data (http://www.dimcax.com/hust/showthread.php?t=18451)

yang686526 2009-05-07 03:08 PM

【转帖】retrieving 3dsolid Data
 
retrieving 3dsolid data
retrieving 3dsolid data
i have created several 3dsolid in acad (cylinder, box, extrude).
i want to import this entity in my cad.
my code working only for solid type of cylinder
code:

...
odrxinitmodelergeometry();
....
static void improddb3dsolid(oddb3dsolid* psolid)
{
odmemorystreamptr mem = odmemorystream::createnew();
psolid->acisout(mem, kaftypeascii|kafver400);
int len=mem->length();
if (!len)
return;
odbinarydata data;
data.resize(mem->length());
mem->seek(0, oddb::kseekfromstart);
mem->getbytes(data.asarrayptr(), mem->length());
odbrbrep brep;
odbrerrorstatus es=brep.set((const char*)data.asarrayptr());
if (es != odbrok)
return ;
odbrbrepedgetraverser bet(brep);
while (!bet.done())
{
odbredge edg;
bet.getedge(edg);
odgecurve3d* thecurve = null;
if (edg.getcurve(thecurve) != odbrok)
return ;
impcurve3d(thecurve, psolid);
bet.next();
}
}
i can't get edge for extrude or box.
help me, please.
attached files
try next :
...
odrxinitmodelergeometry();
....
static void improddb3dsolid(oddb3dsolid* psolid)
{
if (!psolid)
return;
odbrbrep brep;
psolid->brep(brep);
odbrbrepedgetraverser bet(brep);
while (!bet.done())
{
odbredge edg;
bet.getedge(edg);
odgecurve3d* thecurve = null;
if (edg.getcurve(thecurve) != odbrok)
return ;
impcurve3d(thecurve, psolid);
bet.next();
}
}
i get error---->'brep' : is not a member of 'oddb3dsolid'
what kind of ddt version do you use?
quote:
originally posted by alexander rumyantsev
what kind of ddt version do you use?
dwgdirect 1.10, 1/23/2004
oddb3dsolid::brep was added in 1.11.
i cannot reproduce your situation in 1.10. it is very strange that one 3dsolid works normaly, and other didn't work. can you tell me in what place you have error (code line) ?
btw : 1.11 is available, try to use new ddt version. 1.11 is much better than 1.10 for acis/solid support.
last edited by sslezkin; 17th june 2004 at 04:53 amfff">.
no any error.
just for any solid no edge.


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