AnsweredAssumed Answered

How to write multi-value metadata properties using arcobjects?

Question asked by FugroGermany on Aug 14, 2019
Latest reply on Aug 14, 2019 by FugroGermany

Hi all,

 

I try to update metadata using ArcObjects. This is easy for simple properties such as "dataIdInfo/idCitation/resTitle" using IPropertySet.SetProperty(Name, Value). But I can't find any information or example, how to add values for multivalue-properties such as "dataIdInfo/themeKeys/keyword".

 

This works (code snippet):

...

pMetaData = pDatasetName

Dim pPropSet As IPropertySet

pPropSet = pMetaData.Metadata

pPropSet.SetProperty("dataIdInfo/idCitation/resTitle", "Test1")

pMetaData.Metadata = pPropSet

 

But I want to write a few tags:

dataIdInfo/themeKeys/keyword:  AAA
dataIdInfo/themeKeys/keyword:  BBB

 

The result of:

pPropSet.SetProperty("dataIdInfo/themeKeys/keyword", "AAA")

pPropSet.SetProperty("dataIdInfo/themeKeys/keyword", "BBB")

 

is this:

   Tags:

   BBB, BBB, BBB, BBB, BBB, BBB, BBB

All tags contained so far have been replaced with the last keyword (there were 7 tags before).

 

Also this don't work (ArgumentException):

Dim pNames(1), pValues(1) As String

pNames(0) = "dataIdInfo/searchKeys/keyword"

pNames(1) = "dataIdInfo/searchKeys/keyword"

pValues(0) = "AAA"

pValues(1) = "BBB"

pPropSet.SetProperty("dataIdInfo/searchKeys/keyword", pValues)

 

Or this (ArgumentException):

pPropSet.SetProperties(pNames, pValues)

 

How to deal with it?

Outcomes