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

regen question
regen question
hi,
i have an app which creates a dwg database, populating it with graphical entities, but doesn't include a viewer. all it does is create a dwg file, and you need to use autocad to view it.
the problem i have is that the lines i create are not displayed with the correct linestyles until i do a "regen" in autocad. is there any way i can attach something to the database i create that avoids having to do a regen once in autocad in order to see the correct linestyles?
tony rowe
i should add that this only applies to polylines. normal line entities seem to not require a "regen".
tony rowe
could you attach a sample file illustrating the problem?
yes, no problem, see attached.
for some reason the model is in the top left hand corner of the screen even though i called a fittoview function in my code. i am not sure if there is a bug with this function or not.
anyway, the polylines there are displayed as continuous lines. they should have a line style, which you only see after performing a "regen" command.
attached files (240.4 kb, 7 views)

quote:
for some reason the model is in the top left hand corner of the screen even though i called a fittoview function in my code.
the drawing contains a few entities far from its main part so zoomextents takes care of having them visible on screen (at the bottom and the right side).
even after regen i can't see polylines with linetype. they all seem to be displayed as continuos.
do you mean polylines of 136 color with fence_on_boundary_8 linetype?
yes, those polylines. any clues?
tony
i can't see the linestyle because liscad.shx is required to display it.
i think that because the initial view in your drawing is too large autocad considers the linetype too dense to display.
after regen is performed the graphic cache is regenerated and linetype gets visible.
yes, you are correct, thanks, the linestyle is displayed correctly if i reduce the extent of the view.
just on this fittoview command, i attach a file which i created and called the fittoview command, but on opening, all the data appears on the left hand side. can you see any reason why this is so, shouldn't it be nicely in the centre?
tony rowe
attached files (302.4 kb, 5 views)

i'm not sure what do you mean by fittoview but if a file is opened in autocad with different window aspect ration (height/width) than the picture may be displaced.
experiment: in autocad with maximized window (width > height) draw a circle, do zoom extents and save file.
adjust window size to have height > width. open the file again.
you see no the circle.
do zoom extents, save the file and close it.
maximize autocad window.
open the resaved file.
circle is displaced.
to have the picture "nicely in the center" you need to have the same window proportions when the file was saved and than it is opened.
sorry, fittoview is the dgn equivalent, i meant prec->zoomextents();
the file has just been created by my software and i am opening it for the first time in autocad to view it, so i'm not sure how the window ratio can be a reason here...
any further insight as to why the attached dwg file is not displayed centrally, rather it is to the left of the screen when the file is first opened? it is still happening in 2.7 production release.
also, is there any way i can call a regen on the database as it is being written? does this make sense? i can do a zoomextents(), how can i also call a regen command? i have a vc project similar to the odwrite example.
can anyone help here? i await an answer urgently.

quote:
how can i also call a regen command?
copy of regen command from odamfcapp (must be called before m_pdevice->update()):
code:
m_pdevice->invalidate();
if(m_pdevice->gsmodel())
m_pdevice->gsmodel()->invalidate(odgsmodel::kinvalidateall);
thanks,
but isn't this just a regeneration of an mfc view/window, rather than a call to the autcad regenerate function. i am assuming they do different things completely, because i don't want my view in my program updated, rather when a user opens up my newly created autocad dwg, he/she shouldn't need to do a regenerate to see his/her linestyles, which is what is happening at the moment.
tony
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】oddbleader question yang686526 DirectDWG 0 2009-05-06 07:51 PM
【转帖】autodesk, odx and arxdbx question yang686526 DirectDWG 0 2009-05-04 04:32 PM
【转帖】acis question yang686526 DirectDWG 0 2009-05-04 03:38 PM
【转帖】assembly drawing bom change question yang686526 American standards 0 2009-04-29 06:31 PM
【转帖】video card driver question yang686526 SolidWorks二次开发 0 2009-04-13 03:16 PM


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


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