Deepak Gupta

Macro is changing custom properties in both files

Discussion created by Deepak Gupta on Jan 12, 2018
Latest reply on Jan 16, 2018 by Jonathan Westcott
Branched from an earlier discussion

Try these codes

 

Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swCustProp As SldWorks.CustomPropertyManager
Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swCustProp = swModel.Extension.CustomPropertyManager("") 'Add config name in the quotes if you want configuration specific property
    swCustProp.Add3 "Description", 30, "Test 123", 1 ' Change property name as needed
End Sub

Outcomes