AnsweredAssumed Answered

How to change size of tapped hole?

Question asked by Yong Ning on Dec 29, 2015
Latest reply on Dec 30, 2015 by Mike Spens

Hole Specification

The Hole Specification options vary depending on the hole type. Use the PropertyManager images and descriptive text to set the options.




Help me , Size. Select a size for the fastener → M16 Change M20



Follow code, don't change M16 → M20


tmp = .ChangeStandard(swStandardISO, swStandardISOTappedHole, "M20")

Result is True






Private Sub ll2()

   Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

      Set SwApp = Application.SldWorks

      Set SwModel = SwApp.ActiveDoc

   Dim SwSelMgr As SelectionMgr

      Set SwSelMgr = SwModel.SelectionManager

   Dim Feature As SldWorks.Feature

   Dim SwFeatData As SldWorks.WizardHoleFeatureData2

       ' Here Write code for selecting the feature

       Set Feature = SwSelMgr.GetSelectedObject5(1)

       Set SwFeatData = Feature.GetDefinition


       With SwFeatData

          tmp = .ChangeStandard(swStandardISO, swStandardISOTappedHole, "M20")


       End With

End Sub




WizardHoleFeatureData2::FastenerSize→This property allows you to get the fastener size for this hole.


Hope, set the fastener size for this hole.



WizardHoleFeatureData2 API problem | SOLIDWORKS Forums