static void CheckAnnotative(void)
{
ads_name en; ads_point p;
if (acedEntSel(_T("\nSelect annotative entity: "),en,p) != RTNORM) return;
AcDbObjectId eid; acdbGetObjectId(eid,en);
AcDbEntityPointer pEnt(eid,AcDb::kForRead);
if (pEnt.openStatus() != Acad::eOk) return;
AcDbAnnotativeObjectPE *ann = ACRX_PE_PTR(pEnt, AcDbAnnotativeObjectPE);
if (ann && ann->annotative(pEnt)) {
AcDbObjectContextInterface *objInt = ACRX_PE_PTR(pEnt, AcDbObjectContextInterface);
if (objInt) {
AcDbObjectContextManager *cManager = acdbCurDwg()->objectContextManager();
if (cManager) {
AcDbObjectContextCollection *col =
cManager->contextCollection(ACDB_ANNOTATIONSCALES_COLLECTION);
if (col) {
AcDbObjectContextCollectionIterator* iter = col->newIterator();
if (iter) {
for (iter->start(); !iter->done(); iter->next()) {
AcDbObjectContext *cont = NULL; iter->getContext(cont);
if (cont) {
AcDbAnnotationScale *pScale = AcDbAnnotationScale::cast(cont);
if (pScale && objInt->hasContext(pEnt,*pScale)){
double scale = 1; pScale->getScale(scale);
double pUnits = 1; pScale->getPaperUnits(pUnits);
double dUnits = 1; pScale->getDrawingUnits(dUnits);
AcString name; pScale->getName(name);
acutPrintf(_T("\nName = <%s> Scale = %g PaperUnits = %g DrawingUnits= %g"),
name.kACharPtr(), scale, pUnits, dUnits);
}
}
}
delete iter;
}
}
}
}
} else {
acutPrintf(_T("\nNot annotative entity!"));
}
}
Minimum error checking done.
ObjectARX SDK 2008 and 2009 has sample: samples\misc\AnnotationScaling
In order to download those old versions of ObjectARX SDK and and see this sample: http://goo.gl/XtJ2x
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
