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

dont chage scale
dont chage scale
hi,
i need read dxf 2d faces and convert to lines, points and circles to add in my company proprietary format.
i making a import routine using vectorizeex sample but i found a problem: when it import dxf it change sizes (changing scale). i need convert faces to lines, points and circles but without change sizes.
please, where i need change in vectorizeex to solve this problem ?
[]s,
celso
help ! ! !
[]s,
celso
im still waiting help ! ! !
help me, please ! ! !
[]s,
celso
hi,
could you prepare test file. for example, it include one very simple 2d face. attach it here and describe your problem more carefully, like - vectorizeex return lines from xyz to xyz0, but autocad draws it from xyz1 to xyz2 or i think that this coordinates should be xyz3 - xyz4. also i need to known your toolkit version.
simple face
tks for your attention.
im including: demodxf.dxf, testelog.txt and demodxf.icn.
well,
i run odvectorizeex in demodxf.dxf and get testelog.txt.
demodxf.dxf have a line with coords from (473251.8392, 7836822.3764) to (473187.1624, 7836754.3456).
in testelog.txt (generated by odvectorizeex) its adjusted to (535.971902, 696.488330) - (454.127925, 499.907385), changing real position and scale.
in my routine i use this returned value (generated by odvectorizeex) to plot in my application but i need real positions and correct scale.
i see in the code this :
code:
odgsdcrect screenrect(odgsdcpoint(0, 0), odgsdcpoint(1000, 1000));
pdevice->onsize(screenrect);
its set viewport to (0,0) (1000,1000). all cordinates are generated between this values.
well, i change this code for this:
code:
odgepoint3d p3dextmin,p3dextmax;
odgsdcpoint pdcextmin,pdcextmax;
p3dextmin=pdb->getextmin();
p3dextmax=pdb->getextmax();
pdcextmin.x=(long)p3dextmin.x;
pdcextmin.y=(long)p3dextmin.y;
pdcextmax.x=(long)(p3dextmax.x + (0.55));
pdcextmax.y=(long)(p3dextmax.y + (0.55));
odgsdcrect screenrect(pdcextmin,pdcextmax);
pdevice->onsize(screenrect);
... but dont solve all troubles. the values dont match with the original. have a large difference (in proprietary format demodxf.icn. open it by notepad to see)...
line coords in my proprietary format (using vectorizeex changed)
(473226.554099, 7836845.262549) (473209.366864 7836803.980551)
please, do you can help me ?
[]s
celso
quote:
originally posted by alexander rumyantsev
hi,
could you prepare test file. for example, it include one very simple 2d face. attach it here and describe your problem more carefully, like - vectorizeex return lines from xyz to xyz0, but autocad draws it from xyz1 to xyz2 or i think that this coordinates should be xyz3 - xyz4. also i need to known your toolkit version.
attached files (6.3 kb, 7 views)

[]s,
celso
last edited by celsolrc; 18th october 2006 at 08:43 amfff">.
hi,
as i understand you'd like to get geometry in world coordinates. so you should just ignore world to eye and eye to screen transformation:
in main() replace:
code:
pdevice = oddbgsmanager::setupactivelayoutviews(pdevice, pdwgcontext);
with
code:
pdevice->setusergicontext(pdwgcontext);
odgsviewptr pview = pdevice->createview();
pview->setview(odgepoint3d::korigin, odgepoint3d::korigin + odgevector3d::kzaxis, odgevector3d::kyaxis, 1., 1.);
pdevice->addview(pview);
pview->add(pdb->getmodelspaceid().safeopenobject(), 0);
and modify exsimpleview::update() like this:
code:
void exsimpleview::update()
{
(static_cast<odgigeometrysimplifier*>(device()->destgeometry()))->setdrawcontext(drawcontext());
seteyetooutputtransform(geteyetoworldtransform());
odgsbasevectorizeview::update();
} // end exsimpleview::update()
its work ! ! ! !
tank you very much ! ! !
its work ! ! !
[]s,
celso
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】adjusting texture bitmap yang686526 DirectDWG 0 2009-05-04 03:47 PM
【转帖】plotting to scale for templates yang686526 American standards 0 2009-04-29 09:17 PM
【转帖】drawing scale yang686526 American standards 0 2009-04-29 07:47 PM
【转帖】view scale yang686526 SolidWorks二次开发 0 2009-04-13 03:17 PM
【转帖】api calls for scale function yang686526 SolidWorks二次开发 0 2009-04-13 08:56 AM


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


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