Like use CustInfo, it's simple.
The use of CustomPropertyManager have little trouble
***********************
use custinfo2 → Low than Solidworks 2006 version have
This property gets and sets the file custom information for the SolidWorks document.
***
use CustomPropertyManager → Heigh than Solidworks 2007 version
This property gets the custom property information for this configuration.
***
use Custinfo2 code is
'''''
Function CustInfoName(SwModel As ModelDoc2)
Dim SwConfig As Configuration, ConfArr, ConfName, CustArr
Dim Str, kk
kk = 2
ConfArr = SwModel.GetConfigurationNames
For ii = 0 To UBound(ConfArr)
Set SwConfig = SwModel.GetConfigurationByName(ConfArr(ii))
ConfName = SwConfig.Name
With SwModel
Str = Chr(34) & "SW-Mass@@" & ConfName & "@" & .GetTitle & Chr(34)
.AddCustomInfo3 ConfName, "质量", 30, "12"
.CustomInfo2(ConfName, "质量") = Str '"""" & Str & """"
Str = Chr(34) & "SW-Material@@" & ConfName & "@" & .GetTitle & Chr(34)
.AddCustomInfo3 ConfName, "材料", 30, "12"
If UCase(.GetTitle) Like "*SLDASM" Then
.CustomInfo2(ConfName, "材料") = "组合件"
Else
.CustomInfo2(ConfName, "材料") = Str '"""" & Str & """"
End If
CustArr = .GetCustomInfoNames2(ConfName)
.ShowConfiguration ConfName
End With
Next ii
End Function
**********************************************************
SolidworksApi macros