高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】no entities in paper-space
no entities in *paper_space?
no entities in *paper_space?
hello,
i磛e got an initial drawing from autocad 2005 with modelspace and two layouts.
the drawing is completely empty, but each layout contains a viewport.
i want to get the viewport data, so i scan the blocktable of the database.
using the simple code below, i always obtain the information, that the first layout is empty (no entities) and the second layout contains two viewport entities.
why does opendesign pretend that the first layout is empty?
(having only one layout, the effect is the same -> the layout contains no viewport).
void debugblocktable(oddbdatabaseptr pdb)
{
// --- open block table
oddbblocktableptr pblocks =
pdb->getblocktableid().safeopenobject();
oddbsymboltableiteratorptr pbtit = pblocks->newiterator();
for ( pbtit->start(); !pbtit->done(); pbtit->step())
{
oddbobjectid recid = pbtit->getrecordid();
oddbblocktablerecordptr precord = recid.safeopenobject();
oddbobjectiteratorptr pentiter = precord->newiterator();
for (pentiter->start(); !pentiter->done(); pentiter->step())
{
oddbobjectptr pobject = pentiter->objectid().safeopenobject();
}
}
}
if you create a new drawing in autocad and do not "visit" paper layouts they are empty.
at the moment you click a paper layout tab autocad creates 2 viewport entities in the layout. first of them is overall paper space viewport and the second - model viewport (displaying model entities).
no entities in paper layout means that the layout was not visited in autocad and is not initialized yet.
sergey slezkin
thank you for your answer, now i know why there is always one "extra" viewport to those i can see (the overall viewport).
but i磛e got still a problem with viewports. to substantiate my question here磗 a (large? sorry) description of the problem:
the bussiness is importing autocad dwg or dxf file into the cad system of our company. importing modelspace works fine.
to import layouts i try to use the vectorization framework of opendesign(odgsbasevectorizedevice etc., as shown in the example class exsimpledevice)
ok - i don磘 understand the connection to my code completely, this is what i do:
the inherited function "update" of my class calls all the "xxxxproc" functions of the parent class odgsbasevectorizedevice - in these function calls i add according entities to the blocktablerecord of the layout, to access them later from my program.
this procedure imports for every layout one (which?) view, without consideration of rotated ucs in a viewport. so i try to change the view in the framework, according to each viewport and to repeat the update call.
therefore i need information about the viewports and here磗 the point:
from a dwg file with a single layout, which contains ten viewports, i receive the information, that the layout contains no entities (as no viewports).
running arxdbg shows the layout containing the viewports; creating a dxf file has ten viewport entities - but i can磘 access them.
what is wrong?
|