I am trying to set the bend allowance from a user form. Everything seems to be working except the value of the bend allowance does not change. The return value of PBendData.BendAllowance before the change does match what it currently is and the return value of PBendData.BendAllowance after it is set = Langth.Value / 39.3700787 does match that value. Something seems to be wrong with "swSheetMetal.SetCustomBendAllowance PBendData" but I don’t know what. Anyone have any ideas?
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swfeature As SldWorks.Feature
Dim swSlectionManager As SldWorks.SelectionMgr
Dim swSheetMetal As SldWorks.SheetMetalFeatureData
Dim PBendData As SldWorks.CustomBendAllowance
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
swModel.Extension.SelectByID2 "Sheet-Metal(2)", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0
Set swSelectionManager = swModel.SelectionManager
Set swfeature = swSelectionManager.GetSelectedObject6(1, -1)
Set swSheetMetal = swfeature.GetDefinition
Set PBendData = swSheetMetal.GetCustomBendAllowance
PBendData.BendAllowance = Langth.Value / 39.3700787
swSheetMetal.SetCustomBendAllowance PBendData
swModel.ClearSelection2 True
SolidworksApi macros