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

problem writing polylines
problem writing polylines
hello,
i'm having a problem writing polylines with the dwgdirect library v1.09.
when i write more than one polyline to a file using the code below, i think there is a problem with files written as .dwg.
maybe somebody can point out a mistake i'm making.
i can write the same three plines to .dxf ( only change is kdwg to kdxf in the call to writefile()) and the dxf files are fine.
as for the .dwg files, autocad can read them, but programs written using the old odt libraries, including the invisio viewer and rhino can't. if i write them as acad2000 files, rhino and invisio both skip all but one pline. if i write them as r13 files, rhino skips all but one pline and invisio crashes. however, all combinations using dxf files work correctly.
here's how i make the plines. this function is called for each curve to write as a pline:
bool cconverttodwg::converttopolyline( on_curve* pc, const crhinoobject* pobj)
{
...
check if its a planar curve
make curve into a polyline
...
oddb2dpolylineptr ppl = oddb2dpolyline::createobject();
setentityattributes( ppl, pobj);
oddbblocktablerecordptr pblock = m_currentblockid.safeopenobject( oddb::kforwrite);
oddbobjectid id = pblock->appendoddbentity( pentity);
if( !id.isnull())
for( i = 0; i < polyline.pointcount() && m_vertex_count < 32767; i++)
{
oddb2dvertexptr pv = oddb2dvertex::createobject();
p2dpl->appendvertex(pv);
pv->setposition( odgepoint3d( polyline.m_pline[i].x, polyline.m_pline[i].y, polyline.m_pline[i].z));
}
...
}
when i watch the file being read in to rhino in the debugger, i see entities come in like this:
-lwpline header
-blob with the correct coordinate points for one pline
-vertex that should start the next pline
-next vertex, etc
there are no pline headers after the first one
thanks,
lowell
oddbblocktablerecordptr pblock = m_currentblockid.safeopenobject( oddb::kforwrite);
oddbobjectid id = pblock->appendoddbentity( pplfff"> );
thanks,
laurent
thanks - you're right, but unfortunately that is a typo in posting here, and not in the code as it it in the program.
lowell
does autocad see any problem with dwg file containing your 3 polylines? if not it seems to be a problem of legacy c toolkit. be sure to check the latest c toolkit version.
sergey slezkin
yes, autocad reads the files ok.
but if the odt library doesn't read them that's still a big problem for people trying to use them.
lowell
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】polylines and plineproc in vectorizer yang686526 DirectDWG 0 2009-05-06 10:16 PM
【转帖】missing character while writing dxfdwg9selective and vari yang686526 DirectDWG 0 2009-05-06 05:51 PM
【转帖】memory exception when writing many block insertions yang686526 DirectDWG 0 2009-05-06 05:35 PM
【转帖】explode polylines with different segment width yang686526 DirectDWG 0 2009-05-05 10:08 AM
【转帖】dxf polylines showing numvertices == 0 yang686526 DirectDWG 0 2009-05-05 08:51 AM


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


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