I've been setting up the PDM server for our company and am currently writing scripts to both check and manipulate the file card variables before check in. For example, it converts some fields to all upper-case(Material: Aluminum -> ALUMINUM). I haven't gotten around to working with configurations yet, so currently we are only use the file-level "@" configuration.
Everything has been working alright so far but I seem to have encountered an issue with weldment parts. I can't set the variables for these parts. I am using the SetVar method from the IEdmEnumeratorVariable5 interface. The subroutine I am calling looks like this, though I suspect any attempt to set a variable would fail.
Sub VarToUpperCase(ByRef enumVar As IEdmEnumeratorVariable5, ByVal varName As String, Optional ByVal config As String = "@")
Dim varValue As String = String.Empty
If enumVar.GetVar(varName, config, varValue) Then
enumVar.SetVar(varName, config, varValue.ToUpper)
End If
End Sub
As I said, this seems to be working with other parts/assemblies but not with weldments. I've even testing this by saving two copies of a part, making one a weldment(Insert -> Weldments -> Weldment), and checking them into PDM, and sure enough the weldment part is not having the variables updated.
My suspicion is that it has to do with the configurations that are generated when a part is made into a weldment. Default
Has anyone seen this before or know what might be going on? Any help is appreciated.
SolidworksApi/macros