![]() |
【转帖】items in a layou
items in a layout
items in a layout i need to know which blocks are inserted into (so i can get the attributes) and which text is used in a given layout. short of going through a vectorization process to get the entities in a layout, is there an easier way to do it? quote: originally posted by staylor@tailormade.com i need to know which blocks are inserted into (so i can get the attributes) and which text is used in a given layout. short of going through a vectorization process to get the entities in a layout, is there an easier way to do it? if i understand you correctly, you just need to iterate through paperspace block table record looking for oddbblockreference and oddbtext/oddbmtext entities. vladimir quote: originally posted by vkalinin if i understand you correctly, you just need to iterate through paperspace block table record looking for oddbblockreference and oddbtext/oddbmtext entities. but how can i tell if a given item is in a given layout. say i have two layouts: lay1 and lay2. a text item is in lay1 but not in lay2. how can i tell this easily? quote: originally posted by staylor@tailormade.com but how can i tell if a given item is in a given layout. say i have two layouts: lay1 and lay2. a text item is in lay1 but not in lay2. how can i tell this easily? i don't understand. you iterate a layout, meet the text... vladimir i think this is what you want to know : to iterate through the different views - odbdictionaryptr viewdict = oddbdatabase->getlayoutdictionaryid().safeopenobject(); oddbdictionaryiteratorptr iter = viewdict->newiterator(); for( ; !iter->done(); iter->next ) { oddbobjectid objectid = oddbdatabase->findlayoutname(iter->name().c_str()); oddblayoutptr odlayout = objectid.safeopenobject(); oddbobjectid blocktableid = odlayout->getblocktablerecordid(); oddbblocktablerecordptr odblocktable = blocktableid.safeopenobject(); oddbojbectiteratorptr layoutiter = odblocktable->newiterator(); // voila, here is this layouts iterator :-) } cheers jason anderssen you dont need oddbdatabase->findlayoutname() you may get layout object directly from iterator via getobject() vladimir |
所有的时间均为北京时间。 现在的时间是 11:27 AM. |