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

problems using odmodelergeometrycreator
problems using odmodelergeometrycreator
hi,
i've problems using odmodelergeometrycreator:
problem 1
the function :: odrxgetmodelergeometrycreatorservice();
returns a null-ptr, so all modeller actions are invalid.
i use dd2.2.1, in an older dd2.1.x-version this code worked.
---------------------------------------------------------
problem 2
i have to read / write sab (not sat) files. in all dd-versions where i tested so far, dd seems not to be able to handle sab as i would expect it should work:
is the following code correct ?
odmemorystreamptr mem = odmemorystream::createnew();
odrxclassptr pservice = :: odrxgetmodelergeometrycreatorservice();
if (!pservice.isnull())
{
// this code is skipped in dd2.2.1 as (pservice==null) :-(
odmodelergeometrycreatorptr pcreator;
pcreator = pservice->create();
if (!pcreator.isnull())
{
odarray<odmodelergeometryptr> mgarray;
oddbentityptrarray entityarray;
oddb3dsolidptr pe = oddb3dsolid::createobject();
pe->createbox(10, 20, 30);
entityarray.append(pe);
odresult ressat = pcreator->createsat(entityarray, mem, kafver700 | kaftypebinary, true); // this returns eok in dd2.1.x
// here i usually would save mem to disk, and do what ever i like
// days later i would reload mem and continue :
odresult resin = pcreator->createmodeler(mgarray, mem, true);
// resin reports an error: egeneralmodelingfailure
}
}
thanks
dirk
problem 1: i think that "modelergeometry.drx" module missed in application.exe folder.
code:
toolkit_export odrxclassptr odrxgetmodelergeometrycreatorservice()
{
odrxclassptr pservice = odrxservicedictionary()->getat(dd_t("odmodelergeometrycreator"));
if (pservice.isnull())
{
odrxmoduleptr pmodule = odrxdynamiclinker()->loadapp(rx_modeler_geometry_appname);
if (pmodule.get())
{
pservice = odrxservicedictionary()->getat(dd_t("odmodelergeometrycreator"));
}
}
return pservice;
}
last edited by sslezkin; 2nd march 2007 at 04:54 amfff">.
problem 2: please, add
mem->rewind();
before
odresult resin = pcreator->createmodeler(mgarray, mem, true);
thanks, that worked.
now i have a second problem. i have a sab file from another software (using acis). this file is saved as acis 7.00 sab format. it can't be loaded with dd220.
i get an exception with the description "brep error 2".
i do not know if this file is corrupt or if dd has a problem.
the file is attached. it should contain a simple box.
thanks
d.demand
attached files (1.2 kb, 3 views)

hi,
what was a method of attachment creation ? spatial acis library based application or something else?
is it possible to attach sat and dwg file ? dwg is a better.
i found that sab has slightly different file format from autocad generated. one of color attribute stores vector data like set of 3 double, but autocad stores it like vectorid + 3 double.
last edited by sslezkin; 5th march 2007 at 03:37 amfff">.
yes its spatial acis based. its using version acis 14.
but the file is saved to version 7
i attached the dwg zip
attached files (3.5 kb, 3 views)

hi,
problem was with rgb_color-st-attrib, but there is no rgb_color-st-attrib in dwg so it cannot help.
i think that it is a bug in toolkit. so it will be fixed in the next release, also i can email to you changes, if you are founding member of oda.
please, test attachment with spatial acis. it is output of toolkit acisout as sab. is it readable with spatial acis?
attached files (1.3 kb, 1 views)

yes i can load the file. i could load the old file from oda too.
no we are no founding members, so the quick changes do not help me. :-(
if you need more info, search the web for "sat save file format".
you will find a pdf file.
sab files an the color attribute is described there too.
thanks for the quick answers.
d.demand
thanks.
i have sat\sab documentation.
our acisbuilder tested with autocad's sab\sat in general. 99% of tests we got from autocad dxf\dwg files and 1% from spatial acis. so here is potencial bugs due to differences between autocad & spatial acis.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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



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


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