Hello everyone,
I have a question about custom property management in solidworks
Can we change a custom property from an assembly, let me explain:
I have an assembly open and from this assembly "CO37662-33867_Ensemble_goulotte_sortie" I want to modify the custom property of a part "CO37662-33867F09-1"
Is it possible without opening the room?
I made a piece of code in VBA for testing but it doesn't work
' ******************************************************************************
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("CO37662-33867F09-1@CO37662-33867_Ensemble_goulotte_sortie", "COMPONENT", 0, 0, 0, False, 0, Nothing, 0)
Part.CustomInfo("No_article") = 2000200
' fonctionne dans une piece
'boolstatus = Part.AddCustomInfo3("", "No_article", 1, "")
'Part.CustomInfo("No_article") = 2000200
End Sub
Thank you for your help