Is there any possibility to extract file properties (including custom and configuration specific) directly export to excel format for multiple files using a macro to run in the SOLIDWORKS task scheduler?
Check this: Another macro to batch manage custom properties
I will try this out and I think this will solve my problem.
I have tried in my system and Macro is working perfectly fine. But the macro is taking custom property "Value / Text Expression" and not the "Evaluated Value". Is it possible to get the evaluated value as few custom property like Material and Weight is not working for my case?. Please find the attached screenshot. Red highlighted value is currently taking in Excel and Green highlighted value is what I am looking in Excel.
Thank you for the feedback.
Let me check if SW Document Manager allows this (from the first look it does - but need to check if it actually works). If so - I will update the macro.
Hi Artem Taturevych,
I have found open-source code for evaluated value of custom and configuration property working for SW. Currently finding the possible way to print in an excel sheet. Please find the source code below for your reference.
'Code start here
Dim swApp As SldWorks.SldWorksDim swmodel As ModelDoc2Sub main()'sub procedure for adding and getting custom propertiesSet swApp = Application.SldWorksSet swmodel = swApp.ActiveDoc
'Declaring config as configuration and setting its value as active configurationDim config As ConfigurationSet config = swmodel.GetActiveConfiguration
'Declaring a variable for custom property manager and setting its valueDim CustomPropMgr As CustomPropertyManagerSet CustomPropMgr = config.CustomPropertyManager'Statement for adding a custom property for which the return value is an integer hence declaring a variable' as integer and setting its value by using add3Dim RetVal As IntegerDim K As Variant
RetVal = CustomPropMgr.Add3("Mass", swCustomInfoType_e.swCustomInfoText, """SW-Mass@Default@Part1.SLDPRT""", swCustomPropertyAddOption_e.swCustomPropertyDeleteAndAdd)If RetVal = 0 ThenMsgBox "Successfully added Custom Property"ElseMsgBox "Failed..!"End IfDim retval2 As IntegerDim valout As StringDim resolvedvalout As StringDim wasresolved As BooleanDim linktoproperty As Booleanretval2 = CustomPropMgr.Get6("MASS", True, valout, resolvedvalout, wasresolved, linktoproperty)MsgBox "The evaluated value is " & resolvedvalout
'Code end here
Retrieving data ...