Any help is greatly appreciated. Here is the subroutine in question
(the code in question has been commented for convenience):
'Begin Code
Sub Process_SheetMetal(swApp As SldWorks.SldWorks, swModel As
SldWorks.ModelDoc2, swFeat As SldWorks.Feature)
Dim swSheetMetal As SldWorks.SheetMetalFeatureData
Dim swCustBend As SldWorks.CustomBendAllowance
Set swSheetMetal = swFeat.GetDefinition
Set swCustBend = swSheetMetal.GetCustomBendAllowance
Debug.Print "PROCESS SHEET METAL"
Debug.Print " +" & swFeat.Name & " [" & swFeat.GetTypeName & "]"
Debug.Print " BendRadius = " & swSheetMetal.BendRadius * 1000#
& " mm"
'Change Default Bend Radius
Dim bRet As Boolean
Dim NewBendRadius As Double
' Rollback to change default bend radius
bRet = swSheetMetal.AccessSelections(swModel, Nothing):
Debug.Assert bRet
' Set new bend radius value
NewBendRadius = (0.083 * 25.4 / 1000)
swSheetMetal.BendRadius = NewBendRadius
' Apply changes to model
bRet = swFeat.ModifyDefinition(swSheetMetal, swModel,
Nothing): Debug.Assert bRet
'Display Results
Debug.Print " New BendRadius = " & swSheetMetal.BendRadius
* 1000# & " mm"
Debug.Print " K-Factor (old) = " & swCustBend.KFactor
'===========================================================================
'===========================================================================
'===========================================================================
'Change Default KFactor
Dim NewKFactor As Double
Set swSheetMetal = swFeat.GetDefinition
Set swCustBend = swSheetMetal.GetCustomBendAllowance
' Set new KFactor value
NewKFactor = 0.456
swCustBend.KFactor = NewKFactor
'Apply changes
'THIS LINE DOES NOT APPEAR TO UPDATE THE ACTUAL MODEL
bRet = swFeat.ModifyDefinition(swSheetMetal, swModel,
Nothing): Debug.Assert bRet
'Display Results
Debug.Print " K-Factor (new) = " & swCustBend.KFactor
'THe above line displays the correct new K-Factor. The model
still does not get updated.
'===========================================================================
'===========================================================================
'===========================================================================
Process_CustomBendAllowance swApp, swModel, swCustBend
End Sub
'End Code
Corey
"Steve Fye" <in...@rhapsodydesignsolutions.com> wrote in message
news:2e772407.04081...@posting.google.com...
Not through the API, but after the macro has run, I manually rebuild,
and check the K-Factor (REdefine Feature for Sheet MEtal) it's still
the original value. Nothing changes.
Help!