Skip to Content
avatar image
Former Member

vb/vba set default table mapping

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
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 12, 2017 at 09:56 PM

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

    Add comment
    10|10000 characters needed characters exceeded