AnsweredAssumed Answered

Set swCustProp = swModel.Extension.CustomPropertyManager("") error

Question asked by Craig Makarowski on Apr 26, 2018
Latest reply on Apr 30, 2018 by Craig Makarowski

I wrote this macro to copy custom properties to the summary page it worked before but now has this error I'm using SW2016 SP5 currently and will be moving to SW2017 soon. Any help or suggestion would be greatly welcome thank you.

here is the source code for the macro:

 

Dim swApp As Object

Sub main()

    Dim swApp             As SldWorks.SldWorks

    Dim swModel          As SldWorks.ModelDoc2

    Dim swCustProp     As CustomPropertyManager

    Dim val                   As String

    Dim valout              As String

    Dim bool                As Boolean

 

 

 

    Set swApp = CreateObject("SldWorks.Application")

    Set swModel = swApp.ActiveDoc

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

      

    bool = swCustProp.Get4("PART_NAME", False, val, valout)

    swModel.SummaryInfo(swSumInfoTitle) = valout

    bool = swCustProp.Get4("DRAWN_BY", False, val, valout)

    swModel.SummaryInfo(swSumInfoAuthor) = valout

    bool = swCustProp.Get4("Part_Type", False, val, valout)

    swModel.SummaryInfo(swSumInfoKeywords) = valout

   

    'swModel.SummaryInfo(swSumInfoComment) = valout

   

    'swModel.SummaryInfo(swSumInfoSubject) = valout

    swModel.ForceRebuild3 (False)

    swModel.Save

 

 

 

End Sub

Outcomes