高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】rendering Problem - Not Displaying Some Blocks
rendering problem - not displaying some blocks
rendering problem - not displaying some blocks
hi,
attached is a file that is rendered incorrectly with the new rendering classes - it works fine with the old ones (i'm using dd 1.10 update 1); the problem is that some blocks are not rendered completely - to see it just open the file in odamfc app and sitch between the new/old rendering versions; if i explode these blocks all works fine;
thanks,
tiago gehring
attached files
new rendering classes incorrectly treat blockreferences on invisible layer :-(
sergey slezkin
sergey,
i know that you should have a lot of work and (from my own experience) it's very annoying when someone keeps asking when will some feature/fix be avaiable , but this is really important for us, i'm trying to find a workaround until the problem is fixed in dd (any forecast....?); what i tried to do is simply remove all objects that belong to hidden layers before rendering it (just when printing), code is below. this didn't work, i think i have to purge erased entities from database before rendering it, but i'm not sure (if i save the dwg after erasing the entities i can't even render it anymore, i did something stupid for sure..);
could you please give me some more advice on this problem, as i said this is important because some drawings are being partially not printed and this is giving lots of troubles for us;
thanks for your attention,
tiago
code:
typedef std::set <oddbobjectid> setlayers;
void _removehiddenobjects (oddbdatabaseptr ptrdb)
{
oddblayertableptr ptrlayertable = ptrdb->getlayertableid ().openobject ();
oddbsymboltableiteratorptr ptriterator = ptrlayertable->newiterator ();
setlayers sethiddenlayers;
for (ptriterator->start (); !ptriterator->done (); ptriterator->step ())
{
oddblayertablerecordptr ptrlayer = ptriterator->getrecord (oddb::kforread);
if (ptrlayer->isoff () || ptrlayer->isfrozen ())
{
sethiddenlayers.insert (ptrlayer->objectid ());
}
}
if (!setlayers.empty ())
{
_removehiddenentitiesblocktable (oddbblocktablerecordptr (ptrdb->getactivelayoutbtrid().safeopenobject()), sethiddenlayers);
}
}
void _removehiddenentitiesblocktable (oddbblocktablerecordptr ptrblocktable, setlayers & setlayers)
{
oddbobjectiteratorptr ptriterator = ptrblocktable->newiterator ();
for (ptriterator->start (); !ptriterator->done (); ptriterator->step ())
{
oddbentityptr ptrent = ptriterator->objectid ().safeopenobject ();
setlayers::const_iterator itlayers = setlayers.find (ptrent->layerid ());
if (itlayers != setlayers.end ())
{
ptrent->upgradeopen ();
ptrent->erase ();
}
else
{
if (ptrent->iskindof (oddbblockreference::desc ()))
{
oddbblockreferenceptr ptrblkref = ptrent;
_removehiddenentitiesblocktable (ptrblkref->blocktablerecord ().safeopenobject (), setlayers);
}
}
}
}
your file attached to the first post shows the following problem:
imagine a block with circle on default (zero) layer and a line on visible layer (say layer_1).
if such block insertion is on invisible layer (say layer_2) in autocad circle will be invisible and line will be visible.
in dd the whole block will be invisible.
as a temporary work around you can find all block references on invisible layers and do the following with each of them:
explode, look through the result of explode and erase all entities on layer zero (since they inherit visibility from block reference entity). in example above after explode circle having zero layer should be erased, line - not.
sergey slezkin
|