I understand that you are trying to display logical components allocated to an architectural component using a ".mldatx" allocation file in System Composer. The most effective way to visualize these allocations is through the Allocation Editor, which you can open via the System Composer toolbar or using the command
systemcomposer.allocation.open('filename.mldatx')
Within the Allocation Editor, selecting a component and clicking Show Allocations will visually highlight the corresponding linked components across the source and target models, enabling interactive navigation and inspection.
While your script correctly identifies allocations programmatically, for visualization purposes, you can also create a custom architecture view using "createView" and "addElement" to display just the allocated components. It is generally better to use the built-in allocation mechanism rather than stereotypes for linking, since allocations natively support many-to-many relationships. If needed, you can attach metadata to the allocations themselves using allocation stereotypes, which is more scalable than managing multi-value enums or strings on components.
Please find attached the documentation of "Allocation Editor" for reference:
I hope this helps.