![]() |
【转帖】oddbattribute.adjustalignment90 not working correctly
oddbattribute.adjustalignment() not working correctly
oddbattribute.adjustalignment() not working correctly direct v.1.08, acad format 2004 i am updating attribute values in dwg files with code similar to the following; //get an attribute obj pointer oddbattributeptr attptr = attiterator->objectid().safeopenobject(); //need to modify, dont throw exception attptr->upgradeopen(); //replace the value attptr->settextstring( mynewvaluestring ); //recalc insertion data attptr->adjustalignment(); what then happens is, for instance, middle/centered text aligns a slight amount to the right, the longer the string, the more the misalignment. since these attributes are in title blocks, they end up bleeding over the right edge of the box boundries. thanks in advance bill stamp, synergis adjustalignment() needs access to the font file to recalculate text position correctly. probably the required font file is inaccesible and default metrics are used. oddbhostappservices::findfile() is responsible for locating the correct font file. it's default implementation uses environment variable acad as a list of search paths. you can override its behavior in your oddbhostapp inheritor. sergey slezkin thanks much - that did the trick. |
所有的时间均为北京时间。 现在的时间是 12:12 AM. |