cancel
Showing results for 
Search instead for 
Did you mean: 

Using VBScript, create Table References in a PDM and add them to the default diagram

02-26-2019 4:08 PM
freym05 Explorer
1145 views 2 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

I have an application where I have reverse engineered a database I have a vbscript that correctly matches Table Columns and generates a Reference object between the two Tables. What I haven't quite figured out is how to render them within the default diagram, has anyone done anything similar to this within SAP PowerDesigner scripting.

Thanks in advance, Mike

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

freym05
Explorer
0 Likes

Thank you Ondrej, works perfectly, appreciate the response. As a follow-up that someone may find useful there was also a need to add these to the diagram (there's only 1) which is as follows which was added after the above code fragment:

For Each pdmDiag In Model.PhysicalDiagrams
pdmDiag.AttachLinkObject tableRef, pdmParentTable, pdmChildTable
Next

Answers (1)

Answers (1)

Ondrej_Divis
Contributor
0 Likes

Hi Michael,


it is quite simple. Here is the code which displays already existing references on current diagram. For displaying tables, it is very similar, you just need to use the function AttachObject instead AttachLinkObject.

For each ref in Activemodel.References
  Set sym = ActiveDiagram.AttachLinkObject(ref)
Next

HTH,

Ondrej