高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
|