Hello,
using PD 16.1,
in a XEM i have the following structure of Extended Objects:
![screen1.PNG]()
The following code is reading a part of this structur :
Dim m As ExtendedObject
Dim n As ExtendedComposition
Dim so As ExtendedSubObject
Dim prio
Dim col
Set col = InputModel.GetCollectionByStereotype("InformaticaMapping")
For Each m In col If m.Code = "M_xyxyxyxyxyxxyxy_Nachladen" Then Output ">" & m.Code Dim ec As ExtendedCollection Dim ecc 'As ExtendedCollection For Each ec In m.ExtendedCollections Output "ec-->" & ec.Name & " - " & ec.ClassName & " - no Stereotype" For Each ecc In ec.Content Output "ecc---->" & ecc.Name & " - " & ecc.ClassName & " - " & ecc.Stereotype Dim eccec As ExtendedCollection For Each eccec In ecc.ExtendedCollections Output "eccec------>" & eccec.Name & " - " & eccec.ClassName & " - no stereotype" Output "------>" & eccec.UOL If ec.Name = "Source/Target2PDM" Then Dim x For Each x In eccec.Content Output "--- ------>" & x Output "--- ------>" & x.Code & " - " & x.Stereotype & " - " & x.GetExtendedAttribute("PDM Name") If x.Stereotype = "PDM" Then Dim y y = getPDMbyName(x.Code) If x = y Then Output "------- PDM object found !!! -----" End If Next x End If Next eccec Next ecc Next ec End If
Next m
which creates the output:
? select_objects()
>M_xyxyxyxyxyxxyxy_Nachladen
ec-->SourceTarget - Extended Collection - no Stereotype
ecc---->target_0000_******************- Sourcetarget - Sourcetarget
eccec------>VerwendetesDocument - Extended Collection - no stereotype
------>ExtendedObjects::Sourcetarget XXXXXXXXXXXXXXXXXXXXXXXX::ExtendedCollections::Extended Collection XXXXXXXXXXXXXXXXX.VerwendetesDocument'
ec-->Source/Target2PDM - Extended Collection - no Stereotype
ecc---->Source/TargetPDM_1875 - Source/TargetPDM - Source/TargetPDM
eccec------>ModelName - Extended Collection - no stereotype
------>ExtendedObjects::Source/TargetPDM 'Source/TargetPDM_1875'::ExtendedCollections::Extended Collection 'Source/TargetPDM_1875.ModelName'
--- ------>PDM XYXXYXYXYXXYXXYXX--- ------>xyxyxyxyxyxyxyxyxyxyxyxyxxy - PDM - DM_ODP_TBDI0259KONTRAHT_COUNTER_PARTY
------- PDM object found !!! -----
eccec------>SourceTarget - Extended Collection - no stereotype
------>ExtendedObjects::Source/TargetPDM 'Source/TargetPDM_1875'::ExtendedCollections::Extended Collection 'Source/TargetPDM_1875.SourceTarget'
--- ------>Sourcetarget xyxyxyxyxyxyxyxyxyxyxyxyxy--- ------>lookup_0000_************** - Sourcetarget -
So far so good, but: every thing is working fine because i created all my objects using the PD forms:
![screen2.PNG]()
but now i need to create the objects via VBS automaticly.
I figured out as the point to insert the subobjects into the content object of ec-->Source/Target2PDM - Extended Collection
For Each ec In m.ExtendedCollections If ec.Name = "Source/Target2PDM" Then Dim ecc For Each mst In MSTL Set ecc = ec.Content.CreateNew(PdCommon.cls_ExtendedCollection)
but when i try i always get the following error:
![screen2.PNG]()
all ways trying to use createobject and then adding the object also failed
Any suggestions???
Thanks in advance
DJ