Hi,
I am not sure whether it should be recognized as bug, but at least, I am surprised, because I did not expect that ;-)
Normally (using GUI), it's not possible to create / modify / remove DgnLinks, when an element is locked.
But, using API, it can be done without any problem, no exception or warning is reported that data attached to the element is to be changed. At least, I would expect, that
DgnLinkManager::ReadLinkTree(*treeSpecPtr, true);
returns nullptr when no link exists yet on element and should be created a new one. Or, alternatively, something will be reported by
DgnLinkManager::WriteLinkTree(*linkTree);
Is it WAD and DgnLinks structure can be created regardless it's locked (read-only) or not?
With regards,
Jan
I did some more tests and in my opinion now API breaks the rule that locked element cannot be modified.
Before test code is run, the element is locked and there are no data attached on it:
After the code ran, the element is still locked, but XAttributes are attached on element:
Or, attaching XAttributes (on element) is not recognized as element modification?
Regards,
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
The MicroStation Lock UI and expectations appear simple, yet handle some additional use case Scenarios/Features; like those defined in MicroStation Compatibility Variables (See: CAPABILITY_ELEMENT_LOCK and CAPABILITY_ELEMENTTEMPLATE_HONORELEMENTLOCK).
So, depending on the state of each of those variables (current workspace value), originating element creation method (element or element template), and modification method (api) different results may occur. I presume these points may not be interfering with your results, but can you check to see and expand on what conditions are being encountered?
Thank you,Bob
Hi Bob,
standard DGN V8 mode is used, so I guess both mentioned capabilities are not set explicitly (e.g. switched off). I assume in V8 mode, element locking is supported as a standard feature (at least, it can be set and locked elements are recognized by tools).