Hi All,
I have developed a couple of MDL applications for our organisation. The first will scan through a model and automatically convert our old Survey symbol fonts to our current Survey symbol cells. The second allows us to scan through a model and enable annotation scale on those same cells (among other things).
With both of these applications, I was having an issue whereby if I had some planimetrics (temporary graphics) displayed in InRoads Survey, these temporary graphics would also be affected. And in the case of the first application written to the model.
I have devised a way to identify planimetric elements using XAttributes.For each element I am about to process I check for XAttributes with the handler ID of XATTRIBUTEID_ElementHandler (22252). I then read in the first two bytes of the XAttribute data. The first byte seems to change depending on the type of planimetric element. However the second byte seems to always equate to 32757 (0xf57f).
//Extract element handler attribute Element::XAttributeHandlerId handlerId (XATTRIBUTEID_ElementHandler, 0); Element::XAttributeIter handler(pElem, handlerId, Element::XAttributeIter::MATCH_ANY_ID); short sAttrData[2] = {}; if (handler.IsValid()) { void const* pData = handler.PeekData(); memcpy(sAttrData, pData, 8); //Check if handler corresponds to InRoads Survey planimetrics //move on if it does if (32757 == sAttrData[1]) return SUCCESS; }
So far, in testing this has proved to be a reliable way of identifying planimetric elements.
Can anyone confirm that this is a reliable way to detect planimetric elements? Will it continue to be reliable in subsequent versions of InRoads survey?
The Bentley documentation on this sort of thing is particularly scarce. It would be nice to know a bit more about how Bentley use XAttribute and Linkage data for these sorts of situations.
Thanks
Liam