I have a drop down menu that was just added to our custom properties.
It has two values, P or M.
Is it possible to update a library full of components to one of the options in the drop down list using the task scheduler or other means?
I have a drop down menu that was just added to our custom properties.
It has two values, P or M.
Is it possible to update a library full of components to one of the options in the drop down list using the task scheduler or other means?
You could write a macro to open all the files in a folder and change the property to the required one and save.
Dim swApp As SldWorks.SldWorks
Dim swModel As ModelDoc2
Dim swCustProp As CustomPropertyManager
Dim Property As Variant
Dim sFileName As String
Dim Path As String
Dim nErrors As Long
Dim nWarnings As Long
Option Explicit
Sub main()
Set swApp = Application.SldWorks
Path = "Path of your Folder here"
Property = 'p'
sFileName = Dir(Path & "*.sldprt")
Do Until sFileName = ""
Set swModel = swApp.OpenDoc6(Path + sFileName, swDocPART, swOpenDocOptions_Silent, "", nErrors, nWarnings)
Set swModel = swApp.ActiveDoc
Set swCustProp = swModel.Extension.CustomPropertyManager("")
swModel.AddCustomInfo3 "", "Property", swCustomInfoText, Property
swModel.Save
swApp.CloseDoc swModel.GetTitle
Set swModel = Nothing
sFileName = Dir
Loop
End Sub
So far, the easiest solution I have found is to load all the parts into a single assembly, select them all in the tree and from there I can change the mass properties for all at once and then save the temporary assembly which updates the parts.