4 Replies Latest reply on Jun 14, 2018 1:16 PM by Craig Makarowski

    PDM Standard Workflow and Custom properties show up as blank in conditions and actions tests

    Craig Makarowski
      PDM Standard Work flow configuration issue. Well i have setup Conditions and actions to submit a drawing in the Work flow. Only to find that this as built config in the data card that copied from when i put in vault that doesn't copy to the Default which was originally the default is now blank and my work flow only sees default from the drop down of the variables. very disappointed in no macros, and this as built state that we are forced to use. Default should copy to default period not as built. how do i get teh work flow to see all the variables that are in the as built config and have come from the parts/assemblies / drawings that i have added to my standard vault? I do not want to have to edit every part and assembly and drawing that i add to the vault (duplication of work) for thousands of files! SolidWorks sure has goofed on this! I was so close to having a work work flow!

       

      Better yet how do i put a part/drawing into the vault so that the default config has the variables loaded? sure is not right when it is the default in the first place.

      I have put many custom properties in to my parts, Library part assemblies, and drawings, just want to get PDM standard to play nice and boy is this circular!!
        • Re: PDM Standard Workflow and Custom properties show up as blank in conditions and actions tests
          Craig Makarowski

          here are the actions and they only see the default  config variables not the @ (as built)config which Solidworks copies from the adding to vault of the part or drawing!

          default in Vault

           

          as built

          • Re: PDM Standard Workflow and Custom properties show up as blank in conditions and actions tests
            Craig Makarowski

            I found a Macro that allows me to copy the Custom properties to the Default configuration Properties, with one issue I have no idea why they are blank.

             

             

             

            Here is the macro below

             

             

            Option Explicit

             

             

            Dim swApp As SldWorks.SldWorks

            Dim swModel As ModelDoc2

            Dim sConfigName  As String

            Dim bShowConfig  As Boolean

             

             

            Dim cpm3 As CustomPropertyManager

            Dim names3() As String

            Dim i As Integer

            Dim j As Integer

            Dim NewPropOk As Boolean

            Dim NumProps As Long

            Dim Propname As Variant

            Dim Proptype As Variant

            Dim Propvalue As Variant

            Dim vConfNameArr As Variant

             

             

             

            Sub main()

             

             

                'Set the swApp and swModel required variables, will use the open document

                Set swApp = Application.SldWorks

                Set swModel = swApp.ActiveDoc

               

                If (swModel.GetType = swDocDRAWING) Then

                    'continue

                Else

               

                    'Iterate through all configurations and apply the material

                    vConfNameArr = swModel.GetConfigurationNames

               

                    For i = 0 To UBound(vConfNameArr)

                        sConfigName = vConfNameArr(i)

                        Set cpm3 = swModel.Extension.CustomPropertyManager(sConfigName)

                           

                        'Delete existing configuration specific properties

                        If IsEmpty(cpm3.GetNames) Then

                            'Continue

                        Else

                            names3 = cpm3.GetNames

                            For j = 0 To UBound(names3)

                            swModel.DeleteCustomInfo2 sConfigName, names3(j)

                            Next j

                        End If

                   

                        'Copy the configuration specific properties from the Custom properties

                        Set cpm3 = swModel.Extension.CustomPropertyManager("")

                        If IsEmpty(cpm3.GetNames) Then

                            ' Continue

                        Else

                            names3 = cpm3.GetNames

                            NumProps = cpm3.GetAll(Propname, Proptype, Propvalue)

                            For j = 0 To UBound(names3)

                            NewPropOk = swModel.AddCustomInfo3(sConfigName, Propname(j), Proptype(j), Propvalue(j))

                            Next j

                        End If

                    Next i

               

                End If

                swApp.SendMsgToUser "Parameters Written to Default Configuration"

                   

            End Sub