Hi team ,
I was using the below functions to find a logical /physical Entity /Table from a PDM model using VB script
If mdl.ClassName <> "Physical Data Model" Then
Set tabObj = mdl.FindChildByName(argTname, PdLDM.cls_Entity, "", Nothing, False, False)
Else
Set tabObj = mdl.FindChildByCode(argTname, PdPDM.cls_Table, "", Nothing, False, False)
End if
Now Instead of the table names, I wanted to use Object id of the table to find that object so that I can manipulate the object better . Object ID uniquely identify one object in the model. for example one table has the below object id
?tabObj.ObjectID is {85119B14-8C77-4793-B3B5-2623C64AB532}
when I use the Object id for searching the table using the above functions not working
mdl.FindChildByCode("{85119B14-8C77-4793-B3B5-2623C64AB532}",PdPDM.cls_Table, "", Nothing, False, False)
I am I missing any thing?. Is there is any other function I need to use to fulfill the requirements
Can anybody help
Ani
Request clarification before answering.
Hi,
to search by ObjectID you need to use function, which is meant to search throught ObjectIDs. See my example below.
Set tab = mdl.RetrieveObjectByID("{4BF5DDBB-79A7-4BB4-98E7-E04E97DAB9EB}")You are not mentioning your PD version. I don`t know, when the support of RetrieveObjectByID was added. So in case the code mentioned above is not working for you (because of older PD version), you will have to browse all tables (or entities) using good old For..Next cycle.
For each tab in Activemodel.Tables
If tab.ObjectID = "{4BF5DDBB-79A7-4BB4-98E7-E04E97DAB9EB}" then
' do your stuff here
End if
NextHTH,
Ondrej
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.