Hello
Below is a macro that creates custom properties on the file and on the configurations (pumped from SW and adapted by us given the comments):
' ----------------------------------------------
' Postconditions: The custom property Input1 is added to the file.
' NOTE: Because configurations are not supported in drawings, pass a blank string when the file is a drawing.
'------------------------------------------------
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim retval As String
Dim vConfigNameArr as Variant
Dim vConfigName as Variant
Dim swActiveConf As SldWorks.Configuration
Dim swConf As SldWorks.Configuration
Dim swConfMgr As SldWorks.ConfigurationManager
Dim swDerivConf As SldWorks.Configuration
Dim bRet As Boolean
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swConfMgr = swModel.ConfigurationManager
Set swConfig = swConfMgr.ActiveConfiguration
vConfigNameArr = swModel.GetConfigurationNames
retval = swModel.AddCustomInfo3("", "IsFastener", swCustomInfoYesOrNo, "No")
retval = swModel.AddCustomInfo3("", "Library", swCustomInfoYesOrNo, "No")
retval = swModel.AddCustomInfo3("", "Piece_standard", swCustomInfoYesOrNo, "No")
retval = swModel.AddCustomInfo3("", "Spare", swCustomInfoText, "-")
retval = swModel.AddCustomInfo3("", "Coordinate System", swCustomInfoText, "0")
retval = swModel.AddCustomInfo3("", "Repère_soudure", swCustomInfoText, "-")
retval = swModel.AddCustomInfo3("", "Revision", swCustomInfoText, "-")
vConfigNameArr = swModel.GetConfigurationNames
For Each vConfigName In vConfigNameArr
Set swConf = swModel.GetConfigurationByName(vConfigName)
' Do not assert; will be NULL if (derived) configuration already exists
retval = swModel.AddCustomInfo3(swConf.Name, "Numero_plan", swCustomInfoText, "$PRPSHEET:""SW-File Name(File Name)""")
retval = swModel.AddCustomInfo3(swConf.Name, "Description_French", swCustomInfoText, "-")
retval = swModel.AddCustomInfo3(swConf.Name, "Description_French_2", swCustomInfoText, "-")
retval = swModel.AddCustomInfo3(swConf.Name, "Observation", swCustomInfoText, "-")
retval = swModel.AddCustomInfo3(swConf.Name, "Weight", swCustomInfoText, """SW-Mass@@Défaut@ModelDoc2.SLDPRT""")
retval = swModel.AddCustomInfo3(swConf.Name, "Material", swCustomInfoText, """SW-Material@@Défaut@ModelDoc2.SLDPRT""")
retval = swModel.AddCustomInfo3(swConf.Name, "CREATIONAUTO", swCustomInfoText, "NO")
Next
MsgBox retval
End Sub
' ----------------------------------------------