Challenge
You want to find out which components of the CAD assembly have multiple material links and where none of the links is signed.
Such ambiguous material links may cause troubles e.g. in a BOM derivation process
Solution
1. Create a new macro file in <ECTR-config-dir>\customize\scripts\macros\ambiguousMaterialLinks.txt with following content
<ECTR-config-dir>\customize\scripts\macros\ambiguousMaterialLinks.txt
keylist = KEYLIST_FROM_REFOBJ() setId = CREATE_SET(keylist) /* HASMULTIMATLINK empty - no/only one material HASMULTIMATLINK S - multiple links, one link is signed HASMULTIMATLINK X - multiple links, nothing signed => ambiguous mat link */ ambiguousMatLinksFilter = PARAMETER_MAP( "doc_filter_fields" ) ambiguousMatLinksFilter.HASMATERIAL = "X"; ambiguousMatLinksFilter.HASMULTIMATLINK = "X"; componentsSet = TRANSFORM_SET( setId, "expand_structure" ) ambiguousMatLinksSet = FILTER(componentsSet, "doc", ambiguousMatLinksFilter); result = KEYLIST_FROM_SET(ambiguousMatLinksSet) WRITE_RESULTLIST(result)
2. Define a new SmartContainer in <ECTR-config-dir>\customize\config\default.txt and reference this macro there:
<ECTR-config-dir>\customize\config\default.txt
#ambiguous material links plm.smart.container.AMBIG_MAT_LINKS.name = ambiguous material links plm.smart.container.AMBIG_MAT_LINKS.macro = ambiguousMaterialLinks.txt plm.smart.container.AMBIG_MAT_LINKS.icon = flag/flag_material_2a
3. Use this SmartContainer in the container list for desired documents, e.g. <ECTR-config-dir>\applications\ugs\customize\config\default.txt:
<ECTR-config-dir>\applications\ugs\customize\config\default.txt
plm.om.DOC.containers.UGM = SMART_CONT(AMBIG_MAT_LINKS);the rest of containers...