2 Replies Latest reply on Jun 18, 2018 6:39 PM by Craig Makarowski

    SW-Author property value not displayed in Custom properties

    Sai Ganesh

      Hi,

       

      Is there a way to automatically populate Created by/Author (User name) in custom properties field. As same as the "SW-Last Saved by" property pulled by Property tab builder?

       

      Thanks in advance.

       

      Regards,

      Sai

          • Re: SW-Author property value not displayed in Custom properties
            Craig Makarowski

            Here is a Macro that you can use to copy the author with use the swSumInfoAuthor to yourCustomPropertyauthor

            hope this helps

             

             

             

            Copy below this line into the macro editor

            Sub main()

            Dim swApp As Object

             

             

             

             

             

             

            Dim swModel         As SldWorks.ModelDoc2

             

             

            Dim Value           As String

            Dim Temp           As String

             

             

             

             

             

             

             

             

                Set swApp = CreateObject("SldWorks.Application")

             

             

                Set swModel = swApp.ActiveDoc

             

                If swModel.CustomInfo("Description") <> "" Then

                'swModel.CustomInfo("yourCustomPropertyauthor") = swModel.SummaryInfo(swSumInfoAuthor)

                Else

                'swModel.AddCustomInfo3 "", "yourCustomPropertyauthor", swCustomInfoText, swModel.SummaryInfo(swSumInfoAuthor)

                End If

                 

             

             

             

             

                If swModel.CustomInfo("Description") <> "" Then

                'swModel.CustomInfo("Description") = swModel.SummaryInfo(swSumInfoTitle)

                Else

                'swModel.AddCustomInfo3 "", "Description", swCustomInfoText, swModel.SummaryInfo(swSumInfoTitle)

                End If

               

                If swModel.CustomInfo("swSumInfoCreateDate") <> "" Then

                    swModel.CustomInfo("CREATED_REVISION_DATE") = swModel.SummaryInfo(swSumInfoCreateDate)

                    'Debug.Print "updated CREATED_REVISION_DATE"

                Else

                    swModel.AddCustomInfo3 "", "CREATED_REVISION_DATE", swCustomInfoText, swModel.SummaryInfo(swSumInfoCreateDate)

                    'Debug.Print "added CREATED_REVISION_DATE"

                End If

               

                If swModel.CustomInfo("swSumInfoCreateDate") <> "" Then

                    swModel.CustomInfo("CURRENT_REVISION_DATE") = swModel.SummaryInfo(swSumInfoSaveDate)

                    'Debug.Print "updated CURRENT_REVISION_DATE"

                Else

                    swModel.AddCustomInfo3 "", "CURRENT_REVISION_DATE", swCustomInfoText, swModel.SummaryInfo(swSumInfoSaveDate)

                    'Debug.Print "added CURRENT_REVISION_DATE"

                End If

               

                swModel.ForceRebuild3 (False)

                swApp.SendMsgToUser "Created and last saved date written to Custom properites"

             

             

                'swModel.Save

             

             

            End Sub