ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Associate existing AcdbHatch and AcdbPolyline

4 REPLIES 4
Reply
Message 1 of 5
421232206
670 Views, 4 Replies

Associate existing AcdbHatch and AcdbPolyline

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?

Technology change world! Coding change technology! We coders are coding!
4 REPLIES 4
Message 2 of 5

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
Expert Elite Member

Message 3 of 5

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().

Technology change world! Coding change technology! We coders are coding!
Message 4 of 5


@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
Expert Elite Member

Message 5 of 5

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;

Technology change world! Coding change technology! We coders are coding!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost