Skip to Content
0

vb/vba set default table mapping

Jul 12, 2017 at 01:56 AM

36

avatar image
Former Member

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
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Phillip Lam
Jul 12, 2017 at 09:56 PM
0

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()

Share
10 |10000 characters needed characters left characters exceeded