How to retrieve specific configurations' custom properties values

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Examples >

How to retrieve specific configurations' custom properties values

Description

In this example it's shown how to retrieve a specific custom property value for each document configuration.

Example

Dim codeObject

Set codeObject = CreateObject("DBWJComp.CodeObject")
Dim fileLocation
fileLocation = "X:\SW_Archive\Mandrel\LENS - 01795 0626.sldprt"
On Error resume next
configurations = codeObject.getConfigurations(fileLocation)
If Err Then
 DBWMsgBox Err.description, 64, "Error getting configurations of file " & fileLocation
Else
 DBWMsgBox "Found " & cstr(ubound(configurations)+1) & " configurations"
 For i = lbound(configurations) To ubound(configurations)
  'read custom propery input filename,configuration can be also "" for non configuration specific properties, property name
  myProperty=codeObject.getCustomProperty( fileLocation, configurations(i),"CATEGORY1")
  DBWMsgBox configurations(i) & " - " & myProperty, 64, "Configuration " & i
 Next
End If
On Error goto 0
Set codeObject = nothing