Hello everyone, I've encountered some issues at work. In the following piece of code, I'm trying to modify the properties of the sheet metal folder to the K factor. When I change "swSheetMetalFeatureData.KFactor = 0.8" to "swSheetMetalFeatureData.BendDeduction = 2.5/1000", the code reports an error and displays a runtime error: "438: The object does not support this attribute or method." Please tell me how to modify the code. Thank you all!
Sub Main()
Dim swApplication As SldWorks.SldWorks ' SOLIDWORKS应用程序对象
Dim swModel As SldWorks.ModelDoc2 ' 当前活动文档对象
Dim swFeature As SldWorks.Feature ' 特征对象
Dim swSheetMetalFeatureData As SldWorks.SheetMetalFeatureData ' 钣金特征数据
Dim swEdgeFlangeFeatureData As SldWorks.EdgeFlangeFeatureData ' 边线法兰特征数据
Dim swCustomBendAllowance As SldWorks.CustomBendAllowance ' 自定义折弯余量对象
' 获取当前SOLIDWORKS应用和活动文档
Set swApplication = Application.SldWorks
Set swModel = swApplication.ActiveDoc
' 获取钣金文件夹特征并设置其K因子为0.5
Set swFeature = swModel.FeatureManager.GetSheetMetalFolder.GetFeature
Set swSheetMetalFeatureData = swFeature.GetDefinition
swSheetMetalFeatureData.KFactor = 0.8 ' 设置K因子为0.5
swFeature.ModifyDefinition swSheetMetalFeatureData, swModel, Nothing ' 应用修改
End Sub
