Dear ANSYS team,
Is it safe to assume that each element in medini has
an unique mediniIdentifier property?
That is, if two elements are different, they have different mediniIdentifiers?
Thanks!
Cheers, Andre
Hi Andre,
that's a fair assumption you can make, however, a few remarks:
Hope that helps
Jan
Hi Jan,
Thanks for the prompt reply. That helped a lot!
A think, that I have wondered before: Can the mediniIdentifier be set from a script? Background of my question: We generate parts of our model by scripts and recreation of these parts always show up as differences in Diff&merge. While I had asked in the past to optionally suspend the checking of mediniIdentifier, this seems to not be considered for implementation. Consequently, we could get around this by manually setting a hand-generated identifier for these objects.
Peter, you technically can set a medini identifier in a script (its a normal attribute). however, the script is responsible to make sure the id is indeed unique.
If you assign the same identifier twice the result is unpredictable.
We are currently working on a dedicated feature that allows users to only concentrate on the import script but not on the other parts as re-import (diff/merge) or loading of the model.
Once this is ready (most likely an update site) I will post something here.
Thank you for the immediate response and outlook. In case you need feedback on use-cases I have in mind, feel free to reach out.
Sure, thanks Peter. One think we are not yet 100% sure is indeed the way and API we need to offer to a script to create *safe* unique identifiers
that are specific to a certain technology. For Capella for example (one of the initial supported import formats) it might be okay to just use the EMF IDs
from Capella also in medini, for Excel (second supported importer) it may need a combination of a sheet/row/column or a specific cell content.
So if you have any idea here, please post it. The first version will not have any specific id support though I think.
Sorry, to dig out this old thread again but I stumbled upon the assumed "uniqueness" in 2022R1.
When I derive a variant of a "System/Function Model" via context menu "Derive->Variant", the model itself gets a new mediniIdentifier but all containing elements share the same mediniIdentifier with the source model. Even if I change the name/label of an element in the derived model, the mediniIdentifier is kept, thus having two different elements in my Medini project carrying the same mediniIdentifier.
Is this a recent bug? Up to today I assumed that the mediniIdentifier is also used during compare/merge operations and I use it in scripts the reliably find an element again if it has been moved or renamed.
Kind regards,
Stefan
No problem Stefan, I think you indeed stumbled over a special case )besides the cases mentioned above with sysml importers).
This is not a (recent) bug but instead a rather old feature that may violate the mentione duniqueness rule in the project, so its only unique in a model.
What does the compare/merge operation use then for identification of changed elements? Is there any other (really) unique identifier scripting has access to? Isn't there any GUID from the backend database?
My workaround would now be to create new (unique) mediniIdentifiers for all contained objects after a model variant has been derived. Are there any doubts going this way?
Sorry Stefan for late reply,
well, compare/merge has different matching rules, first on resource/model level, than inside the model (where IDs are unique).
Variants are really special as they have intentionally the same ID.
If you combine the ID of the model proxy and the ID of the element, that should be unique.
I am not sure about the creation of new IDs, its not forbidden though. You may try suffix/prefix the ID to keep the original..
Note that we move away from local file system to a server in mid term, and this will change ID handling completely.
(there is no backend DB yet as we are solely file based).
Regards