几何尺寸与公差论坛------致力于产品几何量公差标准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-06, 07:34 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】oddbdimassoc example for oddb2lineangulardimension or oddbra

oddbdimassoc example for oddb2lineangulardimension or oddbra
oddbdimassoc example for oddb2lineangulardimension or oddbradialdimension
hi,
oddbradialdimension
does anyone have a c++ example which creates an associated oddbradialdimension?
in more detail:
- i first create a polyline containing an arc segment (odgecircarc2d) among other line segments.
-then i would like to create a oddbradialdimension associated to this arc using oddbdimassoc.
i am particualy interested about the part where the oddbdimassoc is created. creating just an unassociated radial dimension worked fine.
oddb2lineangulardimension
if somebody has an example on how to create an associated oddb2lineangulardimension i would also be very interested on the code creating the oddbdimassoc.
help or programming examples would be appreciated. thanks a lot,
christoph
hello christoph,
example project odwriteex contents sample with creating associative dimension (rotated). see "void dbfiller::adddimassoc() method" in dbfiller.cpp.
best regards,
sergey z.
hello sergey,
thanks for your answer. i already use the provided example for rotateddimensions since quite a while. but i was not able to make the oddbradial or the oddb2lineangulardimension associative. wouldn't you have any example which shows the parameters needed to make it working.
thanks,
christoph
try this code (it is no complete)
code:
/**********************************************************************/
/* create an associative dimension */
/**********************************************************************/
oddbdimassocptr pdimassoc = oddbdimassoc::createobject();
/**********************************************************************/
/* associate the associative dimension with the rotated dimension by */
/* adding it to the extension dictionary of the rotated dimension */
/**********************************************************************/
// pdimension - your radial dimension. you need have it created and added to db here
pdimension->createextensiondictionary();
oddbdictionaryptr pdict = pdimension->extensiondictionary().safeopenobject(oddb::kforwrite);
oddbobjectid dimassid = pdict->setat(dd_t("acad_dimassoc"), pdimassoc);
/**********************************************************************/
/* associate the rotated dimension with the associative dimension */
/**********************************************************************/
// dimensionid - your dimension id
pdimassoc->setdimension(dimensionid);
/**********************************************************************/
/* attach the line to the associative dimension */
/**********************************************************************/
oddbosnappointrefptr pointref;
pointref = oddbosnappointref::createobject();
pointref->setosnapmode(oddb::kosmodecen);
pointref->setnearosnap(0.0);
// plineid - your polyline id. you need have polyline created and added to db here
pointref->mainentity().objectids().append(plineid);
pointref->mainentity().subentid().settype(oddb::kedgesubenttype);
// indexlineseg - segment index start 1
pointref->mainentity().subentid().setindex(indexlineseg);
pdimassoc->setosnappointref(oddbdimassoc::ksecondpoint, pointref);
/**********************************************************************/
/* add persistent reactors from the rotated dimension and the line */
/* to the associative dimension */
/**********************************************************************/
pdimension->addpersistentreactor(dimassid);
ppolyline->addpersistentreactor(dimassid);
best regards,
sergey z.
hello sergey,
thanks a lot, now it works! most helpful was your hint: "segmentindex - segment index starts with 1"!
the associative dimension for oddb2lineangulardimension works as well!
however, there seems to be a problem with oddb2lineangulardimension (is it a bug?): if i want an angular dimension between 2 lines with say 112? it creates a circle with a depiced angular dimension of 68?(360?292?, but the circle goes over 292? see the attached .dxf file, for acad 2004). as soon as you open the drawing in autocad and change a property of the angular dimension, it depicts the correct value of 112? is there a bug in dwgdirect 2.3.1 (the version i am currently using).
cheers and thanks a lot
attached files (64.8 kb, 3 views)

hello,
it is realy bug in dwgdirect. we will try to fix it in next release.
as work arround try to use oddb2lineangulardimension::setarcpoint(). arcpoint defined sector in lines cross and also radius dimension arc.
best regards,
sergey z.
hi sergey,
thank you for your hint. the workaround oddb2lineangulardimension::setarcpoint(point) works.
cheers,
christoph
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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



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


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