高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】how can i use oddbarcdimensionsetarcpoin
how can i use "oddbarcdimension::setarcpoint"?
how can i use "oddbarcdimension::setarcpoint"?
i use oddbarcdimension::setarcpoint(), but it don't work.
quote:
originally posted by likeda
i use oddbarcdimension::setarcpoint(), but it don't work.
could you explain more detail your problem?
note: see odwriteex example project (dbfiller.cpp) where this method is used.
best regards,
sergey z.
save arcpoint is not equal read arcpoint
// save dxf file //
testsaveapp::addarcdimension()
{
oddbarcdimensionptr pdimension = oddbarcdimension::createobject();
pdimension->setdatabasedefaults(pdb);
bbtr->appendoddbentity(pdimension);
:
:
odgepoint3d centerpoint1(29.03, 22.16, 0.0);
pdimension->setcenterpoint(centerpoint1);
odgepoint3d arcpoint1(30.75, 22.16, 0.0);
pdimension->setarcpoint(arcpoint1);
:
:
}
// and read dxf file //
testreadapp::readarcdimension()
{
oddbarcdimensionptr pdimension;
:
:
odgepoint3d centerpoint2 = pdimension->centerpoint();
odgepoint3d arcpoint2 = pdimension->arcpoint();
:
:
}
centerpoint1 is equal centerpoint2.
but arcpoint1 is not equal arcpoint2.
(arcpoint2 is "(x,y,z) != (30.75, 22.16, 0.0)")
(arcpoint2 is "(x,y,z) == (0.0, 0.0, 0.0)")
why arcpoint2 is not equal arcpoint1 ?
thanks.
quote:
originally posted by likeda
why arcpoint2 is not equal arcpoint1 ?
thanks.
arc point may be recalculated during building dimension block. this point defines radius dimension arc and location between extention lines. the problem may be wrong result value but where is no enough information to check it. could you attach your file or give all your dimension parameters?
best regards,
sergey z.
please check this problem.
odwriteex example project (dbfiller.cpp)
/************************************************/
/* add an arc dimension to the specified blocktablerecord */
/************************************************/
void dbfiller::addarcdimension(const oddbobjectid& btrid,
const int boxrow,
const int boxcol,
const oddbobjectid& layerid,
const oddbobjectid& styleid)
{
/*******************************************/
/* open the blocktablerecord */
/*******************************************/
oddbblocktablerecordptr bbtr = btrid.safeopenobject(oddb::kforwrite);
oddbdatabase* pdb = btrid.database();
/*******************************************/
/* get the upper-left corner of the box and its size */
/*******************************************/
odgepoint3d point(28.75, 25.0, 0.0);// == m_entityboxes.getbox(boxrow, boxcol);
double h = 3.25;// == m_entityboxes.getheight();
double w = 2.25;// == m_entityboxes.getwidth(boxrow, boxcol);
/*******************************************/
/* add the labels */
/*******************************************/
:
:
/*******************************************/
/* get the lower-left corner of the box */
/*******************************************/
point.y -= h;
/*******************************************/
/* create an arc to be dimensioned */
/*******************************************/
oddbarcptr parc = oddbarc::createobject();
parc->setdatabasedefaults(pdb);
bbtr->appendoddbentity(parc);
odgepoint3d center = point + odgevector3d(w * 1.0 / 8.0, h * 1.0 / 8.0, 0.0);
parc->setcenter(center);
parc->setstartangle(odatoradian(0.0));
parc->setendangle(odatoradian(90.0));
parc->setradius(4.0 / odapi);
/*******************************************/
/* create an arcdimension */
/*******************************************/
oddbarcdimensionptr pdimension = oddbarcdimension::createobject();
pdimension->setdatabasedefaults(pdb);
bbtr->appendoddbentity(pdimension);
/*******************************************/
/* use the default dim variables */
/*******************************************/
pdimension->setdatabasedefaults(pdb);
/*******************************************/
/* set some parameters */
/*******************************************/
pdimension->setcenterpoint(parc->center());
pdimension->setarcpoint(parc->center() + odgevector3d(parc->radius() + 0.45, 0.0, 0.0));
odgepoint3d startpoint;
parc->getstartpoint(startpoint);
pdimension->setxline1point(startpoint);
odgepoint3d endpoint;
parc->getendpoint(endpoint);
pdimension->setxline2point(endpoint);
pdimension->setarcsymboltype(1);
}
i used dbfiller::addarcdimension() function. and save dxf file.
next open this dxf file by autocad lt 2007.
arc point is (x = 0.0, y = 0.0, z = 0.0).
i think arc point is wrong result value.
please check this problem.
thanks.
attached files (57.5 kb, 2 views)
last edited by likeda; 25th july 2007 at 04:36 pmfff">.
hello likeda,
really there is problem with saving arc point in dxf file (no with calculate). we will fix it. thank you for report and detail description.
best regards,
sergey z.
thanks for the instant reply.
arc length dimension "arc point" bug
i am having the same problem (arc length dimension with plane z = 100, saved file != loaded file (arc point z = 0)):
possible bug in builddimension function odarcdimrecomputer.cpp:
m_arcpt has a z value of -100.0
m_arcpt is set to m_arcpt
engine.tarnsformby(mworld2plane) then sets the m_arcpt.z to 0.0
at the end of builddimension function m_arcpt is set to m_arcpt.
the result is that the m_arcpt.z value is now 0.0 where it was -100.0 previously.
transformby is then run on m_arcpt.z, but it does not change the z value.
regards,
james higgs
hello james,
you are right. where is bug in builddimension function arcdimrecomputer.cpp. we will fix it. thank you for report.
possible your dimension has points not in the same plane. could you attach simple source file?
best regards,
sergey z.
last edited by sergey z.; 13th march 2008 at 07:36 amfff">.
re: arclengthdimension bug
i have attached test drawing test.dwg, which shows arc and arc length dim at plane z = -100.
if you open this drawing with dwgdirect, it should look correct.
however, if you save/write the drawing using dwgdirect, and then load/read the drawing again (in autocad or dwgdirect), you will see that the arc length dim is now on plane z = 0.
this bug doe snot seem to have been fixed in 2.5.2.
- james
attached files (90.8 kb, 2 views)
hello james,
you are right. where is bug with recompute arc length dim. but only saving is not enough to reproduce wrong behavior. dimension must be recomputed. we will fix it in next release.
best regards,
sergey z.
|