几何尺寸与公差论坛------致力于产品几何量公差标准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:43 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】oddbentmod90 not able to change handle

oddbentmod() not able to change handle
oddbentmod() not able to change handle
hi,
i am trying to change handle value for an oddbobject. i am using oddbentmod() procedure to change handle, but the handle value never gets changed. there is no exception being thrown either. here is sample code:
code:
//get resbuf for objects
odresbufptr rbold = oddbentget(idold);
odresbufptr rbnew = oddbentget(newid);
odresbufptr start = rbold;
//iterate through to get handle
while(oddxfcode::_gettype( rbold->restype() )!= oddxfcode::handle)
{
rbold = rbold->next();
if(rbold.isnull())
break;
}
while(oddxfcode::_gettype( rbnew->restype() )!= oddxfcode::handle)
{
rbnew = rbnew->next();
if(rbnew.isnull())
break;
}
//get handles
oddbhandle hold = rbold->gethandle();
oddbhandle hnew = rbnew->gethandle();
//change handle value
rbold->sethandle(hnew);
oddbentmod(idold, start);
oddbhandle checkhandle = idold.gethandle(); //here, checkhandle = hold, i expect it to be equal to hnew.
i also tried oddbobject::swapidwith() function if the hnew value was already in the database, but the handle is reverted back to old values on document save and reopen.
can somebody suggest the correct way to modify handle values? is there any example in oda's source?
thanks,
samir
more questions
hi,
any answers/suggestions are welcome that help me figure out "how to modify handles?" as described in above post.
i have another confusion/question too:
what is the difference between odresbuf::valuetype values of krthandle, kdxfhandle, kdxfarbhandle, kdxfxdhandle? i couldn't find any documentation on which handle type should be used for what purpose?
thanks,
samir
whats the purpose of modifying handles of existing objects?
btw, maybe the topic from faq in documentation may help to resolve the problem?
sergey slezkin
hi sergey,
thanks for reply.
quote:
originally posted by sergey slezkin
whats the purpose of modifying handles of existing objects?
a module of our application requires to assign custom handles defined outside drawing to entities in an existing drawing.
well, i think we can alternatively use external data objects. and that is why i was wondering which handle type i should use from krthandle, kdxfhandle, kdxfarbhandle, kdxfxdhandle. i tried to write xdata as kdxfhandle(valuetype = 5) type but when i try to retrieve that handle type it is being reported back as valuetype = 1029 !!!
handle of object existing in database can't be altered by oddbentmod() or by any other method. you can only create a clone of existing object, add it to database with another handle value (if it does not conflict with existing objects) and erase the old one.
valid xdata group codes must be greater than 1000.
sergey slezkin
quote:
originally posted by sergey slezkin
valid xdata group codes must be greater than 1000.
i see, thanks very much for the information. i get correct results by using handle type of kdxfxdhandle.
thanks again.
samir
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】engineering change orders yang686526 American standards 0 2009-04-29 07:52 PM
【转帖】change order yang686526 American standards 0 2009-04-29 06:54 PM
【转帖】dll学习(资料收集) huangyhg vc编程 0 2008-05-17 09:24 PM


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


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