![]() |
【转帖】vc== Project Setup Vc== For 3d Extrusion Create Region
vc++ project setup vc++ for 3d extrusion\ create region
vc++ project setup vc++ for 3d extrusion\ create region hello, iam new to this library and i am trying to create a 3d extrusion using the code below: odrxobjectptrarray curves; odrxobjectptrarray regions; oddb3dsolidptr psolid = oddb3dsolid::createobject(); oddbcircleptr pcircle = oddbcircle::createobject(); pcircle->setcenter(odgepoint3d(3,3,0)); pcircle->setradius(1.); pcircle->setnormal(odgevector3d(0,0,1)); curves.push_back(pcircle.get()); odresult res; oddbregionptr preg; res = preg->createfromcurves(curves, regions); the following error message appears on the last line. i have checked my vc++ project settings but can't detect any errors. i have no problem drawing other 3d objects? error lnk2001: unresolved external symbol "public: static enum odresult __cdecl oddbregion::createfromcurves(class odarray<class odrxobjectptr,class odobjectsallocator<class odrxobjectptr> > const &,class odarray<class odrxobjectptr,clas s odobjectsallocator<class odrxobjectptr> > &)" (?createfromcurves@oddbregion@@sa?aw4odresult@@abv ?$odarray@vodrxobjectptr@@v?$odobjectsallocator@vo drxobjectptr@@@@@@aav3@@z) debug/3dsolid.exe : fatal error lnk1120: 1 unresolved externals any ideas? using code: findstr /m /i /s /c:"createfromcurves" *.lib i found code: lib\vc2003md\dd_acisbuilder_dll.lib lib\vc2003md\dd_vc2003md_acisbuilder.lib lib\vc2003md\dd_vc2003md_db.lib lib\vc2003md\dd_vc2003md_modelergeometry.lib lib\vc2003ml\dd_vc2003ml_acisbuilder.lib lib\vc2003ml\dd_vc2003ml_db.lib lib\vc2003ml\dd_vc2003ml_modelergeometry.lib lib\vc2003mt\dd_vc2003mt_acisbuilder.lib lib\vc2003mt\dd_vc2003mt_db.lib lib\vc2003mt\dd_vc2003mt_modelergeometry.lib you might try linking the appropriate library. these libraries are already specified in the project. i have upgraded to version opendwg1.12.04 and this resolved the issue. iterated then through the regions to extrude: odrxobjectptrarray curves; odrxobjectptrarray regions; double dradius = 3.0; odgepoint3d centerpt; centerpt.x = 1.0; centerpt.y = 1.0; centerpt.z = 1.0; oddbobjectid blockid = pdb->getmodelspaceid(); oddbblocktablerecordptr pblock = blockid.safeopenobject(oddb::kforwrite); oddbcircleptr pcirc = oddbcircle::createobject(); pcirc->setcenter(centerpt); pcirc->setradius(dradius); oddb3dsolidptr psolid = oddb3dsolid::createobject(); curves.push_back(pcirc.get()); odresult res = oddbregion::createfromcurves(curves, regions); odrxobjectptrarray::iterator pit = regions.begin(); odrxobjectptrarray::iterator pend = regions.end(); while(pit != pend) { if (psolid->extrude(oddbregionptr(oddbentity::cast(*pit)), 50, 0) == eok) { pblock->appendoddbentity(psolid); } ++pit; } hello, i’m try code above for create 3dsolid, but odresult res = oddbregion::createfromcurves(curves, regions); returns enointerface. i’m using directdwg 1.12.04, static libraries. how solve this problem? may be some other way for create 3dsolid exist? vitali. hi first lines in oddbregion::createfromcurves are odrxclassptr pservice = odrxgetmodelergeometrycreatorservice(); if (!pservice.get()) return enointerface; odmodelergeometrycreatorptr pcreator = pservice->create(); if (!pcreator.get()) return enointerface; it seems that you forgot modeler library ? look at ... and around odrx_declare_static_module_entry_point(modelermodu le) in odamfcapp.cpp. limitation of createfromcurves: curves (i) an array of curves, containing pointers to oddb3dpolyline oddbarc oddbcircle oddbellipse oddbline oddbpolyline oddbspline the curves must be ordered by start/end points (the end point of each curve must be equal to start point of the next curve, and the last end point should be equal to the first start point). all curves must be in the same plane. also it support only one loop ( doesnt support holes; one array - one ordered loop - one output region ) |
所有的时间均为北京时间。 现在的时间是 04:47 PM. |