as it is known, when I draw a AcdbHatch using the "Hatch" command, I can choose the "associate" checkbox , and the hatch will change when the border changes(the border maybe AcdbPolyline or AcdbMpolygon).
but in some special cases, I need to associate existing Hatches and their borders(the borders are eactly the same with the Hatch),
can any one give me some code about this?
From ObjectARX SDK Docs:
// [...]
pHatch->setAssociative(Adesk::kTrue);
// [...]
// Attach hatchId to all source boundary objects for notification. // AcDbEntity *pEnt; int numObjs = dbObjIds.length(); Acad::ErrorStatus es; for (i = 0; i < numObjs; i++) { es = acdbOpenAcDbEntity(pEnt, dbObjIds[i], AcDb::kForWrite); if (es == Acad::eOk) { pEnt->addPersistentReactor(hatchId); pEnt->close(); } }
dbObjIds contain all AcDbObjectId's of boundary, hatchId is AcDbObjectId of AcDbHatch.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
thank you, I know this example code from SDK, but in the SDK code, the "dbObjIds" is from
pHatch->getAssocObjIds(dbObjIds);
in my case, the hatch has althread been constructed without association with its boundary ojbects, so I can't get "dbObjIds" from the constructed hatch. I am quite curious that there is no method like setAssocObjIds().
@cnngtdly wrote:[...]I am quite curious that there is no method like setAssocObjIds().[...]
But there is a method AcDbHatch::insertLoopAt() which set objectid array of boundary entities.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
I am afraid you misunderstood my meaning.
The Hatch has already been constructed and closed. It has already had loops the same shape with the boundary polylines. What I want to know is How to assoicate an existing Hatch(which has alread had loops) with other boundary objects;