I want to do the following: import a block reference with attributes among which there are those that should contain the current coordinates of an entity from that block, and when I move that block those attributes should be updated in order to keep showing the current coordinates, the same way the dimensions are showing actual measurements even when resized.
I've tried to do this with fields in the attributes. But fields are not updated automatically on i.e. move command and I read that it could be time consuming for larger drawings.
So, the question is, how do I do this without developing custom entities?
EDIT: I forgot to mention that I'm doing this in Visual C++ 2005 with ObjectARX for AutoCAD 2008.
@Anonymous wrote:
I've tried to do this with fields in the attributes. But fields are not updated automatically on i.e. move command and I read that it could be time consuming for larger drawings.
So, the question is, how do I do this without developing custom entities?
Maybe reactors?
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
ObjectARX Developer's Guide -> Advanced Topics -> Notification -> Using Reactors
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
Not quite what you want, but I think may help.
Add a handler to the ObjectModified Event thus:-
CurDb = Application.DocumentManager.MdiActiveDocument.Database AddHandler CurDb.ObjectModified, AddressOf ObjectModified
and add this event.
Friend Sub ObjectModified(ByVal sender As Object, ByVal e As Autodesk.AutoCAD.DatabaseServices.ObjectEventArgs) If isMod Then Exit Sub Dim b As Boolean With e.DBObject If .IsWriteEnabled Then Exit Sub If .Id.ObjectClass.Name = "AcDbAttribute" Then Using tr As Transaction = CurDb.TransactionManager.StartTransaction() Dim ar As AttributeReference = CType(e.DBObject, AttributeReference) With a_Job ar.UpgradeOpen() ' add you code here and if you make an amendment, set b=True If b Then isMod = True : ar.DowngradeOpen() ' isMod prevents loop End With tr.Commit() End Using End If End With isMod = False End Sub
Your code will update tags where needed