Hi,
I like to implement annotation scaling feature (like AcDbText, AcDbHatch, ...) in my custom entities. Does anyone have a solution?
Best regards
To achieve that we recommend you derive your cystom entity from an AutoCAD entity that already supports annotation scaling. Then you get it for free.
...There is a sample in the ObjectARX SDK called AnnotationScaling which has a custom entity defined. I wrote it, so please write to me if you have any questions.
Fenton Webb
Autodesk Developer Network
Hi,
I use your sample to implement annotation scale protocol without deriving from a primitive annotative entity (like AcDbText). Here is what I did:
MyCustomEntityAnnotative::desc()->addX(AcDbAnnotativeObjectPE::desc(), new MyAnnotativePE);
MyCustomEntityAnnotative::desc()->addX(AcDbObjectContextInterface::desc(), new MyAnnotativeContextInterface);
So I only need to derive from my custom entity to have annotation scale protocol. It works but I encountered issues with AutoCAD commands:
I hope it can help someone. I always try to find a solution to this crash.
Regards.
You mention it works, yet you say it also has problems with AutoCAD commands - currently you cannot derive your own Annotative custom entity because not all of the API is public at this time, that's why it doesn't work. The solution is to derive from Annotative objects, as mentioned before.
Sorry for the bad news. If you are ADN member, ask to log a Change Request through the DevHelp online system.
Fenton Webb
Autodek Developer Network
Hi,
I am doing some tests by deriving from AcDbText (following your example), but it seems that methods 'subGetGripPoints' and 'subMoveGripPointsAt' don't work. I want to overload them... Is there a trick?
Best regards,
Jonathan
When you say it doesn't work, what do you mean?
Thanks
Fenton Webb
Autodesk Developer Network
I found the solution. I need to implement the second version of 'subGetGripPoints' with following args: AcDbGripDataPtrArray & grips, const double curViewUnitSize, const int gripSize, const AcGeVector3d & curViewDir, const int bitflags. Then I return 'Acad::eNotImplementedYet' and it call the first version of subGetGripPoints.
My next question is about the specifi context menu for annotative entities (like AcDbText, AcDbHatch, ...), called 'Annotative Object Scale'. Do you know which is the condition used by AutoCAD to determine if this menu will be displayed? My workaround is to create my own AcEdUIContext (exact copy of Annotative Object Scale' one) and to add it to all my custom annotative entities (using acedAddObjectContextMenu).
Regards,
Jonathan
Hi,
Is there a way to create scale dependent object properties for a custom annotative object (derived from AcDbText for example)
Thanks
Tasos
Hi,
I'm sorry I didn't understand what your really want. Can you give an example?
Otherwise, I noticed another little thing. When a custom entity (inheriting AcDbText) is selected and the properties palette opened, I see that it is written Text in the selection combo box instead of the name of the custom entity. Anyone knows a way to fix that?
Best regards,
Jonathan
You can handle IOPMPropertyExtension::GetDisplayName() and return a custom name for DISPID 0x0401 (ObjectName property). This is the name AutoCAD displays in the properties window.
--
Owen Wengerd
ManuSoft
Thanks for your quick reply. I saw this article "Changing the Entity Type name that appears in the OPM window" on the ADN website talking about your solution. But it's necessary to implement COM wrapper and register and... It's a big process only to change the display name of an entity! Moreover, 2013 API OPM methods will change.
Is there an easier way?
Hi there,
Again a litlle thing about annotative custom object deriving AcDbText : Hatching. I cannot find which method I need to implement to make my custom entity dealing with hatching process. Unlike standard entities, method "subExplode" isn't called and hatch ignore my entity to determine its boudaries.
Anyboday have a solution?
Regards,
Jonathan
@fenton.webb wrote:...There is a sample in the ObjectARX SDK called AnnotationScaling which has a custom entity defined. I wrote it, so please write to me if you have any questions.
Fenton Webb
Autodesk Developer Network
Really? I'm very interested in this - but I can see no sample like that in the kit? at least by name.... Can you help me with finding it?
Thanks!
This sample was in ObjectARX SDK 2008 and 2009. You can find and download ObjectARX SDK 2009 from this URL: http://download.autodesk.com/esd/objectarx/2009/ObjectARX_2009_Win_64_and_32Bit.exe
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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