on 12-11-2014 9:04 AM
Hi All
I was creating a script fro creating refrences between 2 tables using Script . I tried the below code
Set Model = PD.OpenModel("D:\test.pdm")
Set tab= Model.FindChildByName("Emp", PdPDM.cls_Table, "", Nothing, False, False)
Now I want to create a refrence beterween emp and dept . I tried the below script
Set ref = tab.OutReferences.CreateNew(PdPDM.cls_Reference)
but it gives errors . I found that the below scripts works for creating new entities
Set tabobject = Model.Entities.CreateNew(cls_Entity)
How to create a reference between 2 tables using the script. Thanks for the help
Ani
Hi,
The OutReferences is not a composition Under table. Therefore, you cannot create the reference as a direct child of the table (because it is not in a metamodel point of view).
Instead you must create the reference Under the model
* set ref = Model.References.CreateNew()
and then attach the child and parent table
* set ref.ParentTable = tab
* set ref.ChildTable = chld
(having chld being the child table you want to attach with reference)
Regards,
Marc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.