Create a new custom vertex property for AcDbPolyline
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create my own custom property that acts just like "Vertex X" and "Vertex Y" properties but without the graphical effect. I just want for every vertex to have a new dynamic property that depends and is connected to each one of the vertices.
I am relatively new to the ObjectARX concept and structure and how AutoCAD works. However, I have quite good understanding of the C++ language.
My thoughts are to, somehow, use the IOPMPropertyExtension and IOPMPropertyExpander. These interfaces can only be used from a wrapper -as I've concluded from the generated code from the wizards and an extensive research-.
So, my guess is that I should create a new custom object derived from AcDbPolyline and then wrap it to implement the needed methods. These methods seem to be:
STDMETHOD(GetElementValue)(/*[in]*/DISPID dispID, /*[in]*/DWORD dwCookie, /*[out]*/VARIANT *pVarOut);
STDMETHOD(SetElementValue)(/*[in]*/DISPID dispID, /*[in]*/DWORD dwCookie, /*[in]*/VARIANT VarIn);
STDMETHOD(GetElementStrings)(/*[in]*/DISPID dispID, /*[out]*/OPMLPOLESTR __RPC_FAR *pCaStringsOut, /*[out]*/OPMDWORD __RPC_FAR *pCaCookiesOut);
STDMETHOD(GetElementGrouping)(/*[in]*/DISPID dispID, /*[out]*/short *groupingNumber);
STDMETHOD(GetGroupCount)(/*[in]*/DISPID dispID, /*[out]*/long *nGroupCnt);
I have not understood how I should implement those.
I know I might have a big misconception about this topic that I have not discovered or lack a lot of knowledge. That's why any comment offering information whould be much appreciated.
Questions:
- How do I implement those methods?
- After that, how can I create my property and "correlate" it to the wrapper?
- If the above questions are wrong, what should I do to achieve my goal?