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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-05, 12:23 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 12:14 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多