AnsweredAssumed Answered

how to write mass property to Summary Information - Custom using macro

Question asked by Lohith Na on Mar 27, 2018
Latest reply on Mar 28, 2018 by Lohith Na

i have below macro for to write Summary Information Configuration Specific macro, but i need write in custom property ??

 

Option Explicit

 

 

    Dim swApp                   As SldWorks.SldWorks

 

 

    Dim swModel                 As SldWorks.ModelDoc2

 

 

    Dim vConfNameArr            As Variant

 

 

    Dim sConfigName             As String

 

 

    Dim i                       As Long

 

 

    Dim sFileName               As String

 

 

 

 

 

Sub main()

 

 

    Set swApp = Application.SldWorks

 

 

    Set swModel = swApp.ActiveDoc

 

 

    sFileName = Mid(swModel.GetPathName, InStrRev(swModel.GetPathName, "\") + 1)

 

 

    vConfNameArr = swModel.GetConfigurationNames

 

 

    For i = 0 To UBound(vConfNameArr)

 

 

        sConfigName = vConfNameArr(i)

 

 

        swModel.AddCustomInfo3 sConfigName, "TArea12", swCustomInfoText, Chr(34) + "SW-SurfaceArea" + "@@" + sConfigName + "@" + sFileName + Chr(34)

 

 

        swModel.AddCustomInfo3 sConfigName, "Mass12", swCustomInfoText, Chr(34) + "SW-Mass" + "@@" + sConfigName + "@" + sFileName + Chr(34)

 

 

    Next i

 

 

End Sub

Outcomes