cancel
Showing results for 
Search instead for 
Did you mean: 

vb/vba set default table mapping

Former Member
0 Kudos

I have the following code below and I have a table with multiple mappings MAPPING_1, MAPPING2, ... I'm trying to figure out how to set the default table mapping or get column mappings for specific mapping.

For Each col In obj.Columns
        firsttime = True
        
        For Each cm In col.Mappings
            x = cm.Parent.Code

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200945
Contributor
0 Kudos

Do you want to run mapping between PDM to PDM?

If so, you can play the following code. The models I used come from Powerdesigner Examples folder.

I open project.cdm and use it to generate project1.pdm.

set TargetModel=openModel("C:\Temp\project1.pdm")
set SourceModel=openModel("C:\Temp\project.pdm")

set dataSource=TargetModel.DataSources.CreateNew()
dataSource.SetNameAndCode "My mapping", "MY_MAPPING"
dataSource.AddSource SourceModel

dataSource.GenerateDefaultMapping()