- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to override subUnhighlight in a custom object consisting of lot of subentities. Which is really hard, because the ObjectArx documentation isn't exactly extensive around this. Right now I'm having trouble with what seems to be a function changing the contents of a const parameter. Look at this:
Acad::ErrorStatus CvWSPolyline::subUnhighlight(const AcDbFullSubentPath& subId /* = kNullSubent */, const Adesk::Boolean highlightAll /* = false */) const
{
// AcDbFullSubentPathArray& highlightedSubents is a global array defined elsewhere, keeping track of which objects are highlighted
static int callNr = 0;
++callNr;
const int gsMarker = (int) subId.subentId().index();
REL_DBGOUT(_T("\n%04d subentId: %d, gsMarker %d"), callNr, (int) subId.subentId().index(), gsMarker);
if (subId.subentId().index() > 0)
{
if (highlightedSubents.contains(subId))
{
REL_DBGOUT(_T("\n%04d subentId %d"), callNr, (int) subId.subentId().index());
highlightedSubents.remove(subId);
REL_DBGOUT(_T("\n%04d subentId %d removed from highlightedSubents, new length %d, gsMarker %d"), callNr, (int) subId.subentId().index(), highlightedSubents.length(), gsMarker);
...which gives the following debug output:
0004 wsModelId: 40, gsMarker 40 0004 subId 40 0004 subId 30 removed from highlightedSubents, new length 2, gsMarker 40
where the value of subId.subentId().index() has changed after the remove call (happen's only if there are more than 1 item in the array). But remove takes a const and subId is a const, so in principle nothing should change, right? An array function simply removing one of it's members shouldn't change that member?
Am I thinking wrong, overlooking something or is this actually an error in ObjectARX?
Thankful for any help!
Solved! Go to Solution.