Community Tip - You can change your system assigned username to something more personal in your community settings. X
A hopefully not too dumb question.
In toolkit, in the structure pro_model_item which is used by ProDimension, ProAnnotation, ProAnnotationElem amongst others you have 3 structure members
typedef struct pro_model_item { ProType type; int id; ProMdl owner; }
I thought the id would be unique but apparently this is not the case (e.g. a gtol and a datum tag). So I was wondering should they be unique and what is the purpose of this id?
Any help is much appreciated.
Solved! Go to Solution.
If there are e.g. 20 notes or rather ProAnnotation's in the part, the ProModelitem's representing them only differ in the id. The type is of course the same (PRO_NOTE) as they're all notes and the owner is also the same because they exist in the same model. The id is the only attribute allowing to distinguish them.
Every valid modelitem is indeed unique within a part model. As you point out correctly, a modelitem doesn't only consist of the id but also of type and owning model. The combination of all three elements builds the uniqueness.
Exception: In an assembly context a certain component can be assembled multiple times. In this case a modelitem is not really unique anymore, because it exists in every assembled instance of the component. In order to distinguish these modelitems, you have to build up a ProSelection by providing the assembly component path (ProAsmcomppath) of the owning component instance.
Thank you for your response. The fact that the combination of the three structure items is unique is logical. However,
The structure item
ProMdl owner
ProMdl is a typedef for void * so this holds a memory address. I guess this points to a structure holding the model (part, assembly, ...) that holds this annotation. So that leaves type and id. I'm still wondering whether this is always unique and what the purpose of the id is? In my opinion, from a database point of view, the id should be unique unless its purpose differs from what the name suggests.
If there are e.g. 20 notes or rather ProAnnotation's in the part, the ProModelitem's representing them only differ in the id. The type is of course the same (PRO_NOTE) as they're all notes and the owner is also the same because they exist in the same model. The id is the only attribute allowing to distinguish them.