高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】attribute definition is read as text item
attribute definition is read as text item??
attribute definition is read as text item??
i'm starting to read/write avematerials. currently i have only the list of materials exporting and importing back in. this is working fine. i am noticing that for each material that i export, i am getting 9 text items created in my model file.
i used odamfcapp to open the file. inside acdbblocktable-rm_sdb, there are about 20 acdbattributedefinition. inside the acdbattributedefinition, if there is text in the "groupcode" 1, it will get imported as though it were a text entity. for example, one of the 9 text items that imports says "nullsurf" "", and another says "nulldisp" "".
any ideas?
thanks,
john
last edited by john pollard; 24th january 2008 at 02:11 pmfff">. reason: typo
in previous ac versions rendering stuff (like lights, materials) was saved as blocks. their parameters (light properties) were represented by attributes/attribute definitions.
oddbattribute and oddbattributedefinition are derived from oddbtext. if your application does something like this:
if (pent->iskindof(oddbtext::desc())
than the attributes and attribute definitions would be imported ad texts.
sergey slezkin
i looked and you were right. that looks like how this translator was written. so i have two follow up questions:
1. what is the proper way to import these now? (or where should i look for some example code?)
2. do i need to make my code work one way if the ac file is old and work another way if the ac file is new?
thanks again!
john
1. examples/odaveex illustrates working with ave stuff.
2. yes (at least currently).
previously (up to r15) autocad used ave rendering stuff (materials, lights, render options etc.)
since ac2004 new objects were introduced (dbmaterials etc.) between ac2004 and ac2007 some products (for example pure autocad) continued using ave materials and some products (for example adt) started using new materials - dbmaterials.
since autocad2007 all products including pure autocad use the same renderer and the same set of render stuff (dbmaterials). but conversion from ave to dbmaterials appeared only in autocad2008.
in dwgdirect we have no conversion between old and new-styled materials, lights, render options.
probably max while reading dwg pays no attention to ave stuff if dwg version is greater or equal to 2004 (or maybe it checks lastsavedby version in dwg).
sergey slezkin
|