We can build a threaded hole by using the HoleWizard5Method(..., SSize,...). So, If I want to change the size of this hole, what should I do? I can only change the size by change it's sketch dimensions, but the name of this hole won't change if I use that way. So, How can I change the "Ssize" directly? If there has an example about it, it will help me a lot.
The name of this hole: "M22 螺纹孔1", for example.
Here is a snipit of VBA code from a macro I wrote to do it.
Do While Not swFeature Is Nothing
If swFeature.GetTypeName2 = "HoleWzd" Then
Debug.Print "Updating: " & swFeature.Name
Set swHoleWizardData = swFeature.GetDefinition
frac = Fraction(swUserUnit.GetConversionFactor * swHoleWizardData.ThruHoleDiameter)
' use Chr(216) for holes that include diameter symbol in their string like "Ø5.0"
bResult = swHoleWizardData.ChangeStandard(swHoleWizardData.Standard2, swHoleWizardData.FastenerType2, frac)
If bResult Then
Result = swFeature.ModifyDefinition(swHoleWizardData, swModel, Nothing)
End If
Set swHoleWizardData = Nothing
End If
Set swFeature = swFeature.GetNextFeature
Loop